Skip to content
OAIT Design System

Design system / Components

Icon button

An icon button runs an action that one well-known icon names on its own: close, menu, save, pause.

When to use

  • Header and row actions with a familiar glyph: "Close", "Menu", "More actions for {name}", "Save job".
  • Controls that float on busy surfaces: the Pause control of moving art and a carousel's pager arrows (outlined). Pagination under a table is not an icon button: its circles take an outline edge (Pagination, canonical §10.13).
  • A toggle that flips one thing about the item it sits on: "Save job" (a bookmark).
  • The main action of a view that has no words, such as a station's "Scan next" (filled; it is that view's one filled control).
  • The adornment inside a field: "Show password", "Clear search" (placed by the text field).

When not to use

Need Use instead
An action whose icon is not universally known, or any main action that has words Button with a label (and an optional leading icon)
Moving to another page from text or a list Link
Choosing one of two to four modes Segmented button
A setting that applies at once in a settings list Switch, in Checkbox, radio, and switch
The language of the page The language switcher, icon-only below 768px by its own rule
Light and dark theme Appearance in settings, and the dark_mode icon button in the header of a product that ships a dark theme (Theme toggle)
Choosing a product in the platform strip The platform strip tiles

Anatomy

  1. Container. A 48×48 circle with a 1px border, transparent unless outlined (D-CAI-07, D-SEM-10).
  2. State layer. A ::before of the icon color over the whole border box (inset: -1px, so no lighter rim shows inside the border), 8% on hover and 12% while pressed.
  3. Icon. 24px (--size-icon-lg), outlined glyph (FILL 0); the filled glyph (FILL 1) while a toggle is on (D-BCP-33).
  4. Tooltip. The plain tooltip repeating the button's name, on pointer rest and on keyboard focus.
  5. Badge (optional). A count badge whose count is part of the name ("Filters, 1 filter on").

Variants

Variant Class Use for Container Icon Border
standard (default) oa-icon-btn Header and row actions: menu, close, save, more none --color-on-surface-variant transparent
filled oa-icon-btn--filled Only when the view's main action has no words; it counts as the view's one filled control --color-primary --color-on-primary transparent
tonal oa-icon-btn--tonal An emphasized icon action beside quieter ones (a Material 3 default, not seen in the products yet) --color-secondary-container --color-on-secondary-container transparent
outlined oa-icon-btn--outlined Floating on a busy surface: the Pause control, a carousel's pager arrows none --color-on-surface-variant --color-outline-variant (border-outline-variant)
  • Toggles (standard and outlined only) carry [aria-pressed]. On: --color-primary-container with the --color-on-primary-container icon at FILL 1 and a transparent border. The filled glyph is the cue that does not depend on color (D-CAI-07, D-CAI-14).
  • The outlined button's hairline may be its only edge because the icon identifies it (V-2, D-ARC-13).
  • The pagination component owns its previous and next circles and their unavailable state.

Sizes

One size.

Size Box Padding Type style Icon Hit area
default 48×48, --size-button-md (size-12) none; the icon is centered none 24px, --size-icon-lg 48px
  • Never a 40px circle with an invisible extender: the visible size is the target (D-CAI-07).
  • Inside a 56px field the button sits 4px from the inline end and from the top and bottom, and the input reserves 56px at its inline end (pe-14) (canonical §10.2, §10.4).

Tokens

Part Property Token (Tailwind)
Container size --size-button-md (size-12)
Container corner --radius-full (rounded-full)
Container fill none; filled --color-primary; tonal --color-secondary-container; pressed toggle --color-primary-container
Container border 1px transparent; outlined --color-outline-variant
Icon color --color-on-surface-variant; filled --color-on-primary; tonal --color-on-secondary-container; pressed toggle --color-on-primary-container
Icon size --size-icon-lg (24px)
State layer opacity --opacity-state-hover, --opacity-state-pressed
State layer fade --duration-short-3, --ease-standard
Disabled icon --color-on-surface at 38% (--opacity-state-disabled-content)
Disabled fill and outline --color-on-surface at 12% (--opacity-state-disabled-container)
Focus ring --size-focus-ring solid --color-focus-ring, --size-focus-offset, round
Tooltip delay --duration-delay-tooltip (500ms)

States

State What changes
Enabled The variant's colors.
Hover Pointer devices only: the layer at --opacity-state-hover over --duration-short-3 --ease-standard; the tooltip appears after 500ms of rest.
Focus-visible The base ring, a circle 2px outside the button; the tooltip shows at once. No focus layer (D-ARC-02).
Pressed The layer at --opacity-state-pressed, at once.
Toggled on [aria-pressed="true"]: the selected look and the filled glyph; the name does not change.
Disabled Native [disabled]: the icon at 38%, filled and tonal containers at 12%, the outline at 12%, no layer. Rare.
Loading None. An icon button that starts a slow task shows its progress beside what changes, as a spinner with words (Progress).
Error None.

Behavior

  • A press runs the action at once. A toggle flips [aria-pressed] and applies at once ("Save job"); the name stays "Save job" in both states (D-CAI-07).
  • A control whose words change is not a toggle: the Pause control switches from "Pause animation" with pause to "Play animation" with play_arrow, and takes no pressed state (canonical §7.5, C-4).
  • Enter and Space press it. In a header it sits in the end cluster; on a card it sits above the stretched title link with position: relative and z-index: var(--z-raised) (Card).
  • Tooltip: after --duration-delay-tooltip of pointer rest, at once on keyboard focus; it stays while hovered and hides on Escape, blur, and pointer-out. The tooltip owns the script and placement (D-CSN-24).
  • Motion: only the layer and the colors change (--duration-short-3); nothing moves or scales (D-SEM-15).

Accessibility

  • Element and name. <button type="button" aria-label="…">, the name in the page language, the icon <span … aria-hidden="true" translate="no">. Never the title attribute alone (D-CAI-07, D-CSN-24).
  • Tooltip. The same words as the name, role="tooltip", tied with aria-describedby="…"; supplementary, never the only copy of anything essential.
  • Names in lists name the thing: "More actions for {name}" (canonical §10.13), "Save job: Frontend Developer (React)" (Global Jobs).
  • Target. 48×48 for every variant (D-LAY-12).
  • Contrast. on-surface-variant is 7.2:1 or more (light) and 5.4:1 or more (dark) on every surface; a standalone icon needs 3:1 (canonical §8.2). The ring is 5.45:1 or more.
  • Forced colors. The transparent border is drawn, so every variant keeps its circle; a pressed toggle keeps its filled glyph; disabled icons turn GrayText.
  • Reduced motion. Everything is instant.

RTL and languages

  • Icons that point mirror with oa-icon--mirror (arrow_back, chevron_right, north_east); close, menu, search, pause, and status glyphs never do (canonical §8.3).
  • Names are translated with the page: "Close" / "إغلاق" / "Fermer"; "Menu" / "القائمة" / "Menu"; "Close message" / "إغلاق الرسالة" / "Fermer le message".
  • Tooltips follow the direction and stay inside the window at a row's edges.

Content

  • The name is a short verb phrase or the destination, in sentence case: "Close", "Menu", "Save job", "Show password", "Pause animation", "Add a person".
  • When a name repeats on a page, add the thing it acts on: "Remove the passkey added 27 October 2026".
  • A toggle's name never flips ("Show password" stays "Show password"); the state is [aria-pressed].

Do and don't

Do Don't
aria-label="Close" plus the tooltip "Close". A title attribute as the only name.
A 48px circle with a 24px icon. A 36 or 44px circle, or 22px icons.
A labeled button for "Install the app". An icon-only button for an action people must guess.
[aria-pressed="true"] and the filled bookmark for "Save job". Changing the name to "Unsave job" when it is on.
The outlined variant for the Pause control over moving art. A filled orange icon button beside the view's filled button.

Code

HTML (reference CSS)

Variants and toggles, from reference/snippets/actions.html:

<button type="button" class="oa-icon-btn" aria-label="Close"><span class="oa-icon" aria-hidden="true" translate="no">close</span></button>
<button type="button" class="oa-icon-btn oa-icon-btn--filled" aria-label="Scan next"><span class="oa-icon" aria-hidden="true" translate="no">qr_code_scanner</span></button>
<button type="button" class="oa-icon-btn oa-icon-btn--tonal" aria-label="Add a person"><span class="oa-icon" aria-hidden="true" translate="no">person_add</span></button>
<button type="button" class="oa-icon-btn oa-icon-btn--outlined" aria-label="Pause animation"><span class="oa-icon" aria-hidden="true" translate="no">pause</span></button>

<button type="button" class="oa-icon-btn" aria-label="Save job" aria-pressed="false"><span class="oa-icon" aria-hidden="true" translate="no">bookmark</span></button>
<button type="button" class="oa-icon-btn" aria-label="Save job" aria-pressed="true"><span class="oa-icon" aria-hidden="true" translate="no">bookmark</span></button>

Arabic:

<div class="ks-row" dir="rtl" lang="ar">
  <button type="button" class="oa-icon-btn" aria-label="رجوع"><span class="oa-icon oa-icon--mirror" aria-hidden="true" translate="no">arrow_back</span></button>
  <button type="button" class="oa-icon-btn" aria-label="القائمة"><span class="oa-icon" aria-hidden="true" translate="no">menu</span></button>
  <button type="button" class="oa-icon-btn" aria-label="إغلاق"><span class="oa-icon" aria-hidden="true" translate="no">close</span></button>
</div>

With its tooltip, from reference/snippets/overlays.html. The demo anchor (oa-tooltip__anchor--demo) shows the tooltip in place; in a product drop that modifier, start the tooltip with hidden and let the tooltip script show it:

<span class="oa-tooltip__anchor oa-tooltip__anchor--demo">
  <button class="oa-icon-btn" type="button" aria-label="Close" aria-describedby="ov-tip-close">
    <span class="oa-icon" aria-hidden="true" translate="no">close</span>
  </button>
  <span class="oa-tooltip" role="tooltip" id="ov-tip-close">Close</span>
</span>

Tailwind CSS v4

<!-- Standard -->
<button type="button" aria-label="Close" class="relative isolate inline-flex size-12 shrink-0 items-center justify-center rounded-full border border-transparent bg-transparent text-on-surface-variant cursor-pointer transition-[background-color,border-color,color] duration-short-3 ease-standard before:pointer-events-none before:absolute before:-inset-px before:-z-1 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity before:duration-short-3 before:ease-standard before:content-[''] hover:before:opacity-(--opacity-state-hover) active:before:opacity-(--opacity-state-pressed) active:before:duration-0 disabled:cursor-default disabled:text-on-surface/38 disabled:before:opacity-0 aria-disabled:cursor-default aria-disabled:text-on-surface/38 aria-disabled:before:opacity-0"></button>

<!-- Variants (aria-disabled takes the same disabled classes) -->
<button class="bg-primary text-on-primary disabled:bg-on-surface/12 aria-disabled:bg-on-surface/12"></button>                         <!-- filled -->
<button class="bg-secondary-container text-on-secondary-container disabled:bg-on-surface/12 aria-disabled:bg-on-surface/12"></button> <!-- tonal -->
<button class="border-outline-variant disabled:border-on-surface/12 aria-disabled:border-on-surface/12"></button>                         <!-- outlined -->

<!-- Toggle (standard or outlined) -->
<button aria-pressed="false" class="aria-pressed:border-transparent aria-pressed:bg-primary-container aria-pressed:text-on-primary-container"></button>

The icon is the family Icon at text-(length:--size-icon-lg), filled while pressed ([font-variation-settings:'FILL'_1]). The Icon mirrors the pointing glyphs of its registry in RTL by itself; never decide it per use with rtl:-scale-x-100 (canonical §8.3). shadcn/ui: Button ghost at the icon size becomes the standard icon button (size-12 text-on-surface-variant); Toggle becomes the icon toggle (canonical §10.1, §2.12).

React

Prop Type Default Description
icon Material Symbols name required The glyph; filled while pressed. Pointing glyphs (arrow_back, chevron_right, north_east) mirror in RTL from the Icon's registry; there is no per-use switch (canonical §8.3).
label string required The accessible name and the tooltip's words, in the page language.
variant 'standard' | 'filled' | 'tonal' | 'outlined' 'standard' filled only for a wordless main action.
pressed boolean none Makes it a toggle ([aria-pressed]); standard and outlined only.
onPressedChange (pressed: boolean) => void none Called with the new state.
tooltip boolean true Show the plain tooltip with the label's words.
disabled boolean false Native disabled; rare.
<IconButton icon="close" label={t('shell.closeMessage')} onClick={dismiss} />
<IconButton icon="bookmark" label={t('jobs.save', { title })} pressed={saved} onPressedChange={setSaved} />