Skip to Content

Icon

Wraps any SVG (or icon element) in a 1em box driven by size. With label it becomes accessible; without one it is decorative (aria-hidden).

import { Icon } from '@gg-software/ui'; <Icon label="Star"> <StarSvg /> </Icon> <Icon size={28}> <StarSvg /> </Icon> <Icon spin label="Loading"> <SpinnerSvg /> </Icon>

Props

PropTypeDefaultDescription
children*ReactNodecontent rendered inside the component
sizestring | numbersize as a px number or any CSS length (drives the 1em box)
spinbooleanfalse
labelstringaccessible label; when omitted the icon is decorative (aria-hidden)
classNamestring

* required · generated from packages/ui/src/display/Icon/Icon.tsx