Skip to content

Icon button

An icon button is a button that shows a glyph in place of words. Use it where the glyph is familiar to all who see it, and give it a label for the tooltip and the screen reader.

Anatomy and sizes

The glyph sits at the center of a square box with corners of 8px, the same as a button's, so the two read as one family.

Medium is the default. Small fits table rows and dense toolbars, and large lines up with medium buttons.

Small, 32 pxMedium, 40 pxLarge, 44 px
Small
32 px box, 16 px glyph
Medium
40 px box, 20 px glyph
Large
44 px box, 20 px glyph
Corner radius
8 px
--radius-lg
Glyph stroke
1.75 on a 24 unit grid
Touch target
44 px on touch screens

When to use it

Use an icon button for an action whose glyph people read at once, such as closing a panel, copying a link or opening more actions. It suits toolbars, headers and table rows, where words would crowd the space.

When people would have to guess, write the words on a button. A destructive glyph, such as the trash on a candidate row, never acts alone: it opens a confirmation, or it deletes and offers Undo.

Variants and states

VariantRestHoverPressedFocusDisabledToggle on
Quiet
Secondary

Every enabled glyph reads at 3 to 1 or more on its fill, and so does the focus ring, in both themes.

Quiet has no fill until the pointer rests on it. Secondary sits on a gray fill, for an action that must be found without pointing, such as copy beside a field.

A press keeps the hover fill and shrinks the box to 94 percent, unless motion is reduced. As a toggle, such as Bold, the button stays pressed on the selected gray, and its label stays the same.

A disabled icon button is drawn at half strength and keeps its place in the tab order.

Quiet
No fill, glyph in muted ink
--text-muted
Secondary
Gray fill, glyph in text ink
--surface-control
Hover and press
The faint hover fill, glyph in text ink
--glass-fill-hover
Toggle on
Selected gray, glyph in text ink
--seg-selected
Disabled
The button at 50 percent opacity

Label and tooltip

The label is a verb and its object: Close panel, Copy link, More actions. A screen reader reads it as the name, and the tooltip shows the same words on hover and on keyboard focus.

A count on the button, such as unread notifications, joins the name: Notifications, 3 unread.

Keyboard and touch

Tab reaches an icon button, and Enter or Space presses it. One that opens a menu opens it on the down arrow too, as a menu button does.

On a touch screen the target is 44 px whatever the box. Keep the centers of neighboring icon buttons at least 44 px apart: 12 px between small boxes, 4 px between medium ones.

Permitted and not permitted

Permitted

  • Close panel with the cross glyph

    A glyph people name the same way

  • More actions at the end of a candidate row

    One small button that opens the row menu

Not permitted

  • A drawn glyph for Approve visa

    Nobody can guess it, so write the words on a button

  • A red delete glyph that deletes at once

    A destructive action needs words or Undo

NextLink

Icon button

A button that shows a familiar glyph in place of words, named by a required label.

  • Kind: component
  • Name: IconButton
  • Page: https://design.werklist.com/components/icon-button
  • Version: 2.1.2

When to use it

  • An action whose glyph people read at once: close, search, copy, download, more actions, menu, the theme switch.
  • Toolbars, headers and table rows where words would crowd the space.
  • Quiet by default. Secondary for an action that must be found without pointing, such as copy beside a field.
  • Toggle: a quiet icon button with aria-pressed, such as a details panel shown or hidden.
  • A row action: one small More actions button that opens the row menu.

When not to use it

  • A glyph people would have to guess: use a button with words.
  • A destructive action as a glyph alone, or a red glyph: use a confirmation or Undo.
  • A glyph with a visible text label next to it: use a button with an icon before its label.
  • Changing the label when a toggle turns on.
  • A native title attribute as the tooltip.

Anatomy

  • Box: 32, 40 or 44 px square, radius 8 px (--radius-lg)
  • Glyph: 16 px in the small box, 20 px in the medium and large boxes, stroke 1.75 on a 24 unit grid, currentColor, aria-hidden
  • Space from glyph to edge: 8, 10 or 12 px
  • Tooltip: The label, 8 px below the box, after 500 ms of pointer rest or at once on keyboard focus, never on touch. Hidden from screen readers, which read aria-label.
  • Focus ring: outline 2 px, offset 2 px (--focus-ring, --focus-ring-width, --focus-ring-offset)
  • Touch target: 44 px on coarse pointers. Neighbors keep their centers at least 44 px apart and their boxes at least 4 px apart
  • Counter: drawn by the Counter component at the top trailing corner, digits aria-hidden, the count joined to the name

Variants

  • quiet: The default: no fill until hover, glyph in muted ink. The only variant that toggles.
  • secondary: A gray fill, for an action that must be visible without pointing.

Sizes

  • sm: height 32 px, padding 8 px around a 16 px glyph
  • md: height 40 px, padding 10 px around a 20 px glyph
  • lg: height 44 px, padding 12 px around a 20 px glyph

States

  • rest: Quiet: no fill, glyph in muted ink. Secondary: gray fill, glyph in text ink. (--text-muted, --surface-control, --text)
  • hover: The hover fill over the ground or the gray fill, glyph in text ink. Only on a pointer that can hover. (--glass-fill-hover, --text)
  • pressed: The hover fill, on touch too, and a scale of 0.94 unless motion is reduced. (--duration-fast, --ease-standard)
  • focus-visible: Outline 2 px at offset 2 px in the focus ring color, and the tooltip shows. (--focus-ring, --focus-ring-width, --focus-ring-offset)
  • disabled: aria-disabled true, focusable, presses canceled, drawn at opacity 0.5 in the colors of its variant.
  • toggle on: aria-pressed true: --seg-selected fill, glyph in text ink. On hover --glass-fill-hover lies over it. (--seg-selected, --text, --glass-fill-hover)

Keyboard

  • Tab, Shift+Tab: Move focus in document order, disabled icon buttons included.
  • Enter, Space: Press, or flip aria-pressed on a toggle.
  • Down arrow, Up arrow: On an icon button with aria-haspopup menu, open the menu at its first or last item.

Accessibility

  • A native button whose accessible name is its label.
  • The glyph is aria-hidden. No title attribute is added.
  • Glyph on fill at 3 to 1 and focus ring at 3 to 1 in every enabled state and both themes.
  • The name does not change with the toggle state. aria-pressed carries the state.
  • Targets of 44 px on coarse pointers.
  • Forced colors: the glyph takes ButtonText, the toggle on state Highlight, focus an outline in Highlight.

Content

  • The label is a verb and its object: Close panel, Copy link, More actions.
  • The tooltip repeats the label word for word.
  • A count joins the name: Notifications, 3 unread.

Tokens

  • --text
  • --text-muted
  • --surface-control
  • --glass-fill-hover
  • --seg-selected
  • --focus-ring
  • --focus-ring-width
  • --focus-ring-offset
  • --radius-lg
  • --duration-fast
  • --ease-standard

JSON

{
  "title": "Icon button",
  "path": "/components/icon-button",
  "url": "https://design.werklist.com/components/icon-button",
  "text": "https://design.werklist.com/agent/components/icon-button",
  "summary": "An icon button shows a familiar glyph in place of words, for actions like closing a panel or copying a link.",
  "version": "2.1.2",
  "kind": "component",
  "name": "IconButton",
  "purpose": "A button that shows a familiar glyph in place of words, named by a required label.",
  "use": [
    "An action whose glyph people read at once: close, search, copy, download, more actions, menu, the theme switch.",
    "Toolbars, headers and table rows where words would crowd the space.",
    "Quiet by default. Secondary for an action that must be found without pointing, such as copy beside a field.",
    "Toggle: a quiet icon button with aria-pressed, such as a details panel shown or hidden.",
    "A row action: one small More actions button that opens the row menu."
  ],
  "avoid": [
    "A glyph people would have to guess: use a button with words.",
    "A destructive action as a glyph alone, or a red glyph: use a confirmation or Undo.",
    "A glyph with a visible text label next to it: use a button with an icon before its label.",
    "Changing the label when a toggle turns on.",
    "A native title attribute as the tooltip."
  ],
  "anatomy": [
    {
      "part": "Box",
      "measure": "32, 40 or 44 px square, radius 8 px",
      "token": "--radius-lg"
    },
    {
      "part": "Glyph",
      "measure": "16 px in the small box, 20 px in the medium and large boxes, stroke 1.75 on a 24 unit grid, currentColor, aria-hidden",
      "token": ""
    },
    {
      "part": "Space from glyph to edge",
      "measure": "8, 10 or 12 px",
      "token": ""
    },
    {
      "part": "Tooltip",
      "measure": "The label, 8 px below the box, after 500 ms of pointer rest or at once on keyboard focus, never on touch. Hidden from screen readers, which read aria-label.",
      "token": ""
    },
    {
      "part": "Focus ring",
      "measure": "outline 2 px, offset 2 px",
      "token": "--focus-ring, --focus-ring-width, --focus-ring-offset"
    },
    {
      "part": "Touch target",
      "measure": "44 px on coarse pointers. Neighbors keep their centers at least 44 px apart and their boxes at least 4 px apart",
      "token": ""
    },
    {
      "part": "Counter",
      "measure": "drawn by the Counter component at the top trailing corner, digits aria-hidden, the count joined to the name",
      "token": ""
    }
  ],
  "variants": [
    {
      "name": "quiet",
      "use": "The default: no fill until hover, glyph in muted ink. The only variant that toggles."
    },
    {
      "name": "secondary",
      "use": "A gray fill, for an action that must be visible without pointing."
    }
  ],
  "sizes": [
    {
      "name": "sm",
      "height": "32 px",
      "padding": "8 px around a 16 px glyph"
    },
    {
      "name": "md",
      "height": "40 px",
      "padding": "10 px around a 20 px glyph"
    },
    {
      "name": "lg",
      "height": "44 px",
      "padding": "12 px around a 20 px glyph"
    }
  ],
  "states": [
    {
      "name": "rest",
      "change": "Quiet: no fill, glyph in muted ink. Secondary: gray fill, glyph in text ink.",
      "tokens": [
        "--text-muted",
        "--surface-control",
        "--text"
      ]
    },
    {
      "name": "hover",
      "change": "The hover fill over the ground or the gray fill, glyph in text ink. Only on a pointer that can hover.",
      "tokens": [
        "--glass-fill-hover",
        "--text"
      ]
    },
    {
      "name": "pressed",
      "change": "The hover fill, on touch too, and a scale of 0.94 unless motion is reduced.",
      "tokens": [
        "--duration-fast",
        "--ease-standard"
      ]
    },
    {
      "name": "focus-visible",
      "change": "Outline 2 px at offset 2 px in the focus ring color, and the tooltip shows.",
      "tokens": [
        "--focus-ring",
        "--focus-ring-width",
        "--focus-ring-offset"
      ]
    },
    {
      "name": "disabled",
      "change": "aria-disabled true, focusable, presses canceled, drawn at opacity 0.5 in the colors of its variant.",
      "tokens": []
    },
    {
      "name": "toggle on",
      "change": "aria-pressed true: --seg-selected fill, glyph in text ink. On hover --glass-fill-hover lies over it.",
      "tokens": [
        "--seg-selected",
        "--text",
        "--glass-fill-hover"
      ]
    }
  ],
  "keys": [
    {
      "key": "Tab, Shift+Tab",
      "action": "Move focus in document order, disabled icon buttons included."
    },
    {
      "key": "Enter, Space",
      "action": "Press, or flip aria-pressed on a toggle."
    },
    {
      "key": "Down arrow, Up arrow",
      "action": "On an icon button with aria-haspopup menu, open the menu at its first or last item."
    }
  ],
  "accessibility": [
    "A native button whose accessible name is its label.",
    "The glyph is aria-hidden. No title attribute is added.",
    "Glyph on fill at 3 to 1 and focus ring at 3 to 1 in every enabled state and both themes.",
    "The name does not change with the toggle state. aria-pressed carries the state.",
    "Targets of 44 px on coarse pointers.",
    "Forced colors: the glyph takes ButtonText, the toggle on state Highlight, focus an outline in Highlight."
  ],
  "content": [
    "The label is a verb and its object: Close panel, Copy link, More actions.",
    "The tooltip repeats the label word for word.",
    "A count joins the name: Notifications, 3 unread."
  ],
  "tokens": [
    "--text",
    "--text-muted",
    "--surface-control",
    "--glass-fill-hover",
    "--seg-selected",
    "--focus-ring",
    "--focus-ring-width",
    "--focus-ring-offset",
    "--radius-lg",
    "--duration-fast",
    "--ease-standard"
  ]
}

Raw file: https://design.werklist.com/agent/components/icon-button