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
| Name | Type | Default | Description |
|---|---|---|---|
| size | string | The size of the icon. | |
| color | string | 'currentColor' | The color of the icon. |
| focusable | boolean | false | Denotes that the icon is not an interactive element, and only used for presentation. |
| role | string | 'presentation' | One of: 'presentation', 'img' |