Skip to content
Nana UI

Forms & Inputs

Icon Button

A compact, icon-only button. Renders a named nana-icon (or slotted icon) and requires a label for accessibility.

View .md Download
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/icon-button";
<nana-icon-button name="edit" label="Edit"></nana-icon-button>
<nana-icon-button name="link" label="Link"></nana-icon-button>

Properties

PropertyAttributeTypeDefaultDescription
disableddisabledbooleanfalseDisable the button
hrefhrefstring | undefined—Render as a link
labellabelstring''Accessible label (required for icon-only controls)
loadingloadingbooleanfalseShow a spinner instead of the icon
namenameIconName | undefined—Named icon to render
sizesizeSize'md'Size
targettarget'_blank' | '_self' | '_parent' | '_top' | undefined—Link target
variantvariantIconButtonVariant'default'Visual style

Events

EventDescription
nana-clickFired on activation

Slots

SlotDescription
(default)Custom icon content (used when name is not set)

CSS parts

PartDescription
::part(button)The underlying button / link

CSS custom properties

PropertyDescription
--nana-icon-button-radiusCorner radius
--nana-icon-button-colorIcon colour
EventTypeDescription
nana-clickCustomEventFired on activation
SlotDescription
(default)Custom icon content (used when name is not set)
VariableDescription
--nana-icon-button-radiusCorner radius
PartDescription
buttonThe underlying button / link element
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Icon Button interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook