Skip to main content

Figma Storybook

IconButton

A compact button that displays a single icon with no text label. Use in toolbars, table rows, or space-constrained UI where the icon alone clearly communicates the action. Don't use when the action needs a label for clarity.

Figma Storybook Docs

Description

What it does

Triggers an action using a single icon with no visible text label. A visually hidden label and tooltip ensure the action remains accessible and discoverable.

Where it appears

Table row actions (edit, delete, archive), toolbar controls, card overflow menus, inline list item actions such as pinning a stakeholder or removing a tag.

Why it exists

Dense data-heavy views in Open Point — stakeholder lists, consultation registers, document tables — need actions that do not consume horizontal space. IconButton preserves layout density while keeping interactions reachable.

Dependencies

Button, Tooltip, Icon

Anatomy

PartRequired?Notes
Container Required Square or circular hit area sized to meet the 44x44px minimum touch target. Background is transparent at rest; fills on hover and active states.
Icon Required A single wa-icon rendered at 20px (default) or 16px (dense). Must have sufficient contrast against its background in all states.
Visually hidden label Required Screen-reader-only text provided via aria-label that names the action. Never omit — icon alone is not sufficient for assistive technology.
Tooltip Recommended A wa-tooltip wrapping the button exposes the label on hover and keyboard focus for sighted users who may not recognise the icon. Omit only when the icon is universally understood in context (e.g., a close X inside an already-labelled dialog).
Focus ring Required 3px solid ring using --op-color-interactive-focus, offset 2px. Always visible on :focus-visible; never suppressed.

Variants

Default

Neutral action with no inherent positive or negative valence

General-purpose actions in toolbars or table rows — editing a record, opening a detail panel, copying a link.

Danger

Destructive or irreversible action

Deleting a stakeholder record, removing a consultation participant, discarding unsaved changes. Renders in --op-color-status-error to signal risk.

Ghost

Low-emphasis action that should recede visually

Secondary actions adjacent to a primary interactive element — collapsing a sidebar, toggling a filter panel, dismissing a non-critical notification.

States

State Behaviour
Default (rest) Transparent background. Icon at --op-color-text-secondary. No border.
Hover Background fills to --op-color-bg-primary (subtle tint). Icon shifts to --op-color-text-primary. Tooltip appears after a 300ms delay.
Focus-visible 3px focus ring at --op-color-interactive-focus with 2px offset. Tooltip appears immediately on keyboard focus so the label is visible without requiring hover.
Active (pressed) Background deepens to --op-color-interactive-default at low opacity (approx 12%). Icon returns to --op-color-text-secondary momentarily.
Disabled Icon and container at 40% opacity. pointer-events: none. aria-disabled='true' on the button element so focus is still reachable and screen readers announce the disabled state.
Loading Icon is replaced by a wa-spinner at the same size. aria-busy='true' set on the button. Interaction is blocked until the action resolves.

Usage guidelines

When to use

  • Space-constrained rows or toolbars where a full text button would break the layout — e.g., the actions column of a stakeholder table.
  • Repeated identical actions across a list where the surrounding context already names the subject — e.g., a trash icon in each row of a document list.
  • Toolbar controls where iconography is well-established and a visible label would create visual clutter — e.g., bold, italic, link in a rich text editor.

When not to use

  • When the icon alone may be ambiguous to the user — use a full Button with a text label instead.
  • As the sole call-to-action on a page or in a form — use a primary Button so the action is unmistakable.
  • In empty-state or onboarding contexts where discoverability matters — use a labelled Button to guide unfamiliar users.
  • When three or more icon actions appear together without grouping — use an overflow menu (ButtonMenu) to reduce cognitive load.

Do / Don't

Do

Always provide aria-label that names the specific action and its subject — e.g., 'Edit stakeholder Jane Smith'.

Don't

Do not use generic labels like 'Button' or 'Click here'. Screen reader users navigating by form controls need unique, descriptive names.

Do

Wrap the IconButton in a wa-tooltip so sighted keyboard and mouse users can discover the action label.

Don't

Do not rely on title attributes for tooltips — they are not announced reliably by screen readers and are inaccessible to keyboard-only users.

Do

Use the danger variant for destructive actions and pair it with a confirmation dialog before executing irreversible operations.

Don't

Do not use a red icon on the default variant as an ad-hoc danger signal — use the proper danger variant so the semantic intent is consistent.

Do

Keep icon size at 20px default (or 16px dense). Scale the container, not the icon, to meet touch target requirements.

Don't

Do not inflate the icon to fill the touch target — oversized icons reduce legibility at a glance in dense tables.

Was this page helpful?

Updated 9 September 2026