0

I am using yarn fluentui/react-northstar and i need to add custom icon using svg as this https://fluentsite.z22.web.core.windows.net/0.53.0/icon-viewer.

is there proper way or guideline to do add custom icons?

1 Answer 1

0

Have you seen this blog post? https://medium.com/swlh/fluentui-react-how-we-cut-more-than-30-of-components-bundle-size-by-creating-icons-package-474019d3123

It implies that this snippet creates a new SVG icon.

import { createSvgIcon } from "@fluentui/react-northstar";
const RobotIcon = createSvgIcon({
  svg: ({ classes, props }) => (
    <svg viewBox="0 0 16 16" className={classes.svg}>{...}</svg>
  ),
  displayName: 'RobotIcon',
});

I haven't test it though, as I am currently looking to do the same with a gif image.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.