BridgeBeta
  • Brand
  • Digital Assets
    Foundations
    Icons
    Components
    Templates
  • Resources
    Design Tokens
    How-tos
    Best Practices
    Libraries
    Accessibility
    Products List
  • Support
    • Overview
    • Build an Icon
    • Contributing Guidelines
    • Developing components
    • Favicons
    • Form Design
    • How to give feedback
    • How to write UX copy
    • Install UI-Kit
    • Migration
    • PWA 📱
    • Replaceable Components
    • Start Designing
    • Support RTL
    • Themes
    • Write documentation
How Tos

Build Icons

Colours for the UN design system

This is a draft. Feedback is much appreciated.

icons-core allows you to create your own icon library. An example project can be found TODO: Update here.

It uses svgo and react-svgr to create optimized svg files and react components.

Create a node script to run the build process:

import path from "path";
import { fileURLToPath } from "url";
import { dirname } from "path";
import { convertFolder, jsx } from "@wfp/icons-core";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const srcFolder = "../icons/src/svg";
const distFolder = path.resolve(__dirname, "dist");
convertFolder(
srcFolder,
distFolder,
jsx /* The converter, can be jsx, svg or a custom converter */
);

Starting the build script from package.json

"scripts": {
"build": "node config.mjs"
}

References

  • Figma
  • npm
Storybook
Figma library
Contact us
2025 © World Food Programme