Skip to main content
Brand and assets
Build
Monitor and contribute
/
Front-end platform
  • Overview
  • Technical architecture
  • Core framework
  • Application
  • global-shell
  • modular-arch
  • Product shells
  • Modules & apps
  • Module directory
  • Apps
  • Bundles
  • Bundle explorer
  • Guides
  • Install Murray
  • Universal components
  • Build a universal component
  • Responsive styles
  • RTL support
  • Translations & i18n
  • When to use Form
  • Positioning elements
  • Add a new icon
  • Utilities
  • Overview
  • Layouts
  • Add a new icon

How to add a new icon

Need to add a new icon to our library? Here's how to do it.

1. Add the SVG file​

Add the SVG file into frontend/svg/material.

2. Adapt the SVG file​

To work properly, the .svg file needs specific fill values:

  • on the root <svg /> tag: fill="none"
  • on any other tag with a fill property, it should be set to fill="black" This allows the script to replace fill="black" by the currentColor and allow customisation of the icon at runtime.
<!-- Before -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#232938">
<!-- After -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">

3. Run the transform script​

All icons are transformed to React components. To do so, run the following command:

~/frontend $ yarn murray:build-svg

How to export it from Figma​

  1. First, make sure the icon is in a frame with a size of 24x24px.
  2. Then, select the icon and go to the export tabs in the right panel.
  3. Select SVG format and export it.

Exporting an icon from Figma

Edit this page
Previous
Positioning elements
Next
Overview
  • 1. Add the SVG file
  • 2. Adapt the SVG file
  • 3. Run the transform script
  • How to export it from Figma