Skip to content
Hazine

Icon and toggle buttons

0 of 5 shipped. Nothing has shipped here yet. The list below is what this family will hold, and how each structure differs.

Planned 5

  • Icon Button with Tooltip

    No visible text: the label prop is mandatory at the type level and renders as tooltip on hover and keyboard focus; the visual can shrink to 20px for dense rows while a pseudo-element keeps the hit area at 24px minimum.

  • Icon Button with Badge

    Overlays an absolutely positioned dot or count on the icon corner with a background-coloured ring cutout; the count is folded into the aria-label ("Notifications, 5 unread") and changes are announced through a polite live region rather than by re-reading the button.

  • Expanding Label Icon Button

    The label lives inside the button and animates width with a grid-template-columns transition instead of using a tooltip layer; the text is always in the accessibility tree, and with prefers-reduced-motion the label appears without animation.

  • Icon Swap Toggle Button

    State is carried by aria-pressed with a stable label ("Bookmark") rather than a changing label, and shown by an icon swap plus fill change with a short scale transition, so state never depends on colour alone.

  • Toggle Button with Count

    Combines aria-pressed with a tabular count that animates one digit step up or down; accepts an async onPressedChange, applies the change optimistically, and reverts both pressed state and count on rejection with a role=status message.