Tonic UI
Getting StartedColor ModeColor StyleVersionsContributing
THEME
BordersBreakpointsColorsOutlinesPositionsSpacingSizesShadowsTypography
BUILDING BLOCKS
BoxControlBox
UTILITIES

SVGIcon

If you need a custom SVG icon, you can use the <SVGIcon> component to extend the native <svg> element:

  • It comes with built-in accessibility.
  • SVG elements should be scaled for a 24x24px viewport.

Import

Usage

You can use the current text color by adding the fill="currentColor" attribute to the <path> or <g> element. This means that the fill color of the SVG will be inherited from the color value of its parent.

EDITABLE EXAMPLE
EDITABLE EXAMPLE

Props

NameTypeDefaultDescription
sizestringThe size of the icon.
colorstring'currentColor'The color of the icon.
focusablebooleanfalseDenotes that the icon is not an interactive element, and only used for presentation.
rolestring'presentation'One of: 'presentation', 'img'