Elementary accessible component to display `svg` icons. It renders a `svg` element.
Elementary accessible component to display svg icons.
It renders a svg element.
``bash`
yarn add @vtex-components/icon
or
`bash`
npm install @vtex-components/icon
- Decorative only
`jsx
import Icon from '@vtex-components/icon'
function UseCase() {
return (
)
}
`
- Grant a11y for standalone usage
`jsx
import Icon from '@vtex-components/icon'
function UseCase() {
return (
)
}
`
| prop | type | description | required | default |
| ------- | ----------- | --------------------- | -------- | ----------- |
| size | number | Icon height and width | 🚫 | 24 |
| title | string | Icon title | 🚫 | - |
| sx | SxStyleProp | ThemeUI Style prop | 🚫 | {} |
| viewBox | string | Same as svg viewBox | 🚫 | '0 0 24 24' |
Use sx` to styling the icon.
For further reading, you can check the Theme Documentation