Icon
Icon
is the base svg primitive for creating accssible icons.
Usage
Basic usage for Icon component.
If no children is provided Icon will render a fallback icon.
Focusable Icon
By passing focusable
prop we can make the icon keyboard focusable.
createIcon
utility
To create icons more easily we provide a createIcon
utility which takes few
props and returns a React component;
Basic usage:
API Reference
Icon
Prop | Type | Default |
---|---|---|
as | string | React.ElementType | svg |
createIcon
Prop | Type | Default |
---|---|---|
viewBox | string | 0 0 24 24 |
path | React.ReactElement | React.ReactElement[] | - |
d | string | - |
displayName | string | - |
defaultProps | PropsWithAs<IconProps, "svg"> | - |