action — wyrd.component.icon-button

IconButton

Square icon-only action primitive named by an explicit accessible label.

Install @wyrd-company/react or the Flutter package and use it directly — your DESIGN.md does the styling.

01

Examples

Generated from the contract's examples block. Previews are the published @wyrd-company/react component, themed by the brand's role tokens — flip the site's light/dark toggle and they follow.

Code target Applies to every example on component pages.
primary state: default
Usage
import { WyrdIconButton } from "@wyrd-company/react";

<WyrdIconButton label="Save" variant="primary" icon="save" />

// events: onPress
loading state: loading
Usage
import { WyrdIconButton } from "@wyrd-company/react";

<WyrdIconButton label="Saving" variant="primary" isLoading icon="save" />

// events: onPress
danger state: default
Usage
import { WyrdIconButton } from "@wyrd-company/react";

<WyrdIconButton label="Delete" variant="danger" icon="delete" />

// events: onPress
02

Properties

NameTypeDefaultSummary
label string undefined Accessible name for the icon-only button.
variant primary | secondary | ghost | danger primary Visual and semantic action emphasis.
is-disabled boolean false Prevents activation and exposes disabled platform semantics.
is-loading boolean false Shows pending action state while preserving dimensions and suppressing duplicate activation.
03

Slots & events

SlotCardinalityAcceptsSummary
icon exactly-one component, icon Visible icon content.
EventPayloadSummary
press source, action Canonical activation event emitted once per accepted activation.
04

Tokens

The contract's token bindings. Open the shared contextual sidebar from any example; primary swatches reflect the color you pick there. Error swatches show the active preset's values; editing any knob switches to custom and resets error to TWW · Ink.

BindingToken
primary.background color.primary
primary.background-hover color.primary-hover
primary.background-pressed color.primary-pressed
primary.foreground color.on-primary
secondary.background color.secondary
secondary.foreground color.on-secondary
ghost.background transparent
ghost.foreground color.primary
danger.background color.error
danger.foreground color.on-error
disabled.background color.disabled
disabled.foreground color.on-disabled
radius rounded.md
size spacing.xl
padding spacing.sm
icon-size spacing.md
05

States

StateSourceSummary
default platform Idle enabled state.
hover interaction Pointer hover state on hover-capable devices.
focus-visible platform Keyboard-visible focus state.
pressed interaction Active press state.
disabled property Disabled state derived from is-disabled.
loading property Pending state derived from is-loading.
06

Accessibility

From the contract's accessibility obligations. Role button; Label property provides the accessible name.

  • Enter activates the button.
  • Space activates the button.
  • Web projections set aria-label from the label property because visible content is icon-only.
  • Flutter projections expose Semantics label and button state from the label property.
  • Disabled state is exposed through native disabled semantics where the target has them.
  • Loading state keeps the accessible name stable and prevents duplicate activation without dimming below contrast.
  • Verified under: rtl, reduced-motion, cvd-deuteranopia, density-compact.
07

SDUI

Status: serializable. IconButton serializes its label, visual state, icon slot, and optional press binding.

SerializableMembers
Propertieslabel, variant, is-disabled, is-loading
Slotsicon
Eventspress
The Wyrding Way — a contract-first design system. © Wyrd Company