Skip to content

Nav Icon

@astryxdesign/core v0.7.1 · NavIcon

NameTypeDefaultDescription
iconClassstring—CSS icon class drawn on the round badge, such as i-carbon-search. Without it the default slot is rendered.
size'sm' | 'md' | 'lg''md'Diameter of the badge.
labelstring—Accessible name. With a label the badge is an image for assistive tech; without one it is hidden, which is right when the text beside it already says what it is.

Slots ​

  • default: the icon content, used when iconClass is not set. Put an Icon or any element of the same size here.

The badge is display-only: it is a span, never a button or a link, so do not hang a click handler on it. Reach for IconButton or NavItem when the thing has to be pressable.