Skip to content
Nana UI

Icon Button

View .md Download

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

Terminal window
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
disabledbooleanfalseDisable the button
hrefstring | undefinedRender as a link
labelstring''Accessible label (required for icon-only controls)
loadingbooleanfalseShow a spinner instead of the icon
nameIconName | undefinedNamed icon to render
sizeSize'md'Size
target'_blank' | '_self' | '_parent' | '_top' | undefinedLink target
variantIconButtonVariant'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
EventTypeDescription
nana-clickCustomEventFired on activation
SlotDescription
(default)Custom icon content (used when name is not set)
VariableDefaultDescription
--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