Icon
Decorates an svg icon with automatic sizing. Useful when applying base styles to phosphor icons.
Accessibility
An Icon is decorative by default. It renders aria-hidden="true" unless the Icon or the svg element itself carries a name (aria-label, aria-labelledby, a <title> child, or Phosphor's alt), a role, or an explicit aria-hidden. A bare Phosphor icon sets none of these, so an icon next to a text label is hidden from assistive technology and the text carries the meaning.
When the icon is the only thing that conveys its meaning, name it:
Examples
Merging classNames
The Icon merges className selectors with the following order of precedence (last one wins):
- SvgOnly base classes (only
"shrink-0") - Icon base classes
- Icon className
- svg className
When className is not specified:
When className is only specified on svg:
When className is only specified on Icon:
When className is specified on both svg and Icon:
API Reference
The Icon accepts the following props: