Skip to content
Site volume
Colourway

Components

IconButton

An icon-only key with the Button's faces and a required name that doubles as its tooltip.

  • Beta
  • Reading layer
  • Server component
  • Since 0.1.0
  • Press check
Import from@maxgrits/overprint-react/icon-button
On this page

Example#

Look of this example
Live render of examples/icon-button/basic.tsx

Usage#

Use an icon button where a glyph alone is understood by everyone: close, search, menu, play, previous and next. It has the Button's faces and travel, in a square key.

  • The name is required. label is the accessible name and the tooltip text, so the action is never a mystery on hover or to a screen reader.
  • Variants. secondary (default), primary for the firm choice and quiet beside other keys, such as a dialog's close key. There is no action variant: the main action always has words.
  • Toggles and counts. pressed makes a toggle key (aria-pressed); count prints a Count at the top-end corner and adds it to the name, such as "Inbox, 3 waiting".
  • Sizes. sm 40, md 44 (default), lg 52 px squares, with 18, 20 and 24 px glyphs from the shape alphabet. On touch screens no key is under 44 px and the tooltip is off; the name is still announced.

Anatomy#

The parts of examples/icon-button/basic.tsx, numbered:
  1. KeyA square Button face with the same rule and offset..mk-icon-button
  2. GlyphOne shape from the alphabet, hidden from assistive tech..mk-icon-button-glyph

Volume#

Reading layer: the key prints the same at every volume, like the Button it is cut from.

  • Quiet

    Docs, forms, legal and long reads. Flat inks, no art in motion.

  • Studio

    The site default. Art on its own plates, one display moment per view.

  • Press

    Hero moments, covers and campaigns. Halftone fields and the second ink.

  • Rave

    Launches, posters and the 404. Every ink, and the words still win.

Content#

  • The label names the action, not the picture: "Close the menu", "Search the docs", never "X" or "Magnifier".
  • Sentence case, a verb first, four words at most, because it is also the tooltip.
  • Use the same glyph for the same action everywhere; a glyph never stands for two things on one site.

Do and don't#

Do

An action that needs words keeps them.

Don't

A mail glyph could mean five things.

Only glyphs everyone reads the same way go icon-only. When a reader has to hover to learn what a key does, it should have been a Button with a label.

Accessibility#

  • label is the accessible name and the tooltip's words, so the tooltip never holds the only copy.
  • The tooltip opens on hover after 400 ms and on keyboard focus, closes on Escape, and never opens from a touch.
  • Squares are 40, 44 and 52 px, and at least 44 px on touch screens.
KeysWhat happens
TabMoves focus to the key; the tooltip opens on keyboard focus
EnterActivates the key
SpaceActivates the key; a toggle flips aria-pressed
EscapeCloses the tooltip and keeps focus on the key

The colour pairs it prints, with their contrast on both papers:

TextSurfaceRoleBoneNight
--mk-text--mk-surface-raiseduinot in this looknot in this look
--mk-on-slab--mk-slablabel 16.49:1 · Lc 98.7, passes 16.21:1 · Lc 95.1, passes
--mk-on-selected--mk-selecteduinot in this looknot in this look
--mk-text--mk-hoveruinot in this looknot in this look

Process at Studio, normal contrast. Every look: the press check.

Props#

PropTypeDefaultDescription
label requiredstringnoneRequired: the accessible name, also the tooltip (a tooltip never holds the only copy, 20 §3).
glyph requiredGlyphNamenoneA shape-alphabet glyph (10 §4.9), drawn at 18 / 20 / 24 px.
tooltipbooleantrueWrap in `Tooltip` on fine pointers (default true).
tooltipSideTooltipSidenone
variantIconButtonVariantnone
sizeSizenone
pressedbooleannone
countnumbernone
countLabel((count: number) => string)none
hrefstringnone
renderRenderPropnone

Plus 288 React and DOM attributes passed through to the root element (className, ref, aria-*, event handlers and the rest). Generated from IconButtonProps in packages/overprint-react/src/reading/icon-button/icon-button.tsx.

Tokens#

System tokens (21)

Its own properties (6)

  • --mk-icon-button-size
  • --mk-key-edge
  • --mk-key-face
  • --mk-key-label
  • --mk-key-offset
  • --mk-key-rule

Scanned from its CSS at build and checked against its registry entry; 1 read but not declared there.

Changelog#

Arrived in 0.1.0.

0.9.024 October 2026

  • MinorreactIconButton's count now prints a Count at its corner. Read the whole entry
  • Patchreactphone-frame: video in a PhoneFrame starts paused with a play and pause key at the frame's bottom end (the client leaf PhoneVideo, on IconButton's markup, named "Play {label}" and "Pause {label}"), instead of the platform's controls (DF-33, supersedes D-N78). Read the whole entry

0.1.024 October 2026

  • MinorreactThe reading layer's controls, overlays, forms and visitor prefs (P2-T1 to P2-T5): every Button is the comic hit key, with IconButton, Link and Tooltip; Input, Textarea, Select, Checkbox and CheckboxGroup, Radio and RadioGroup, Switch, Slider with the ruler, RulerReadout and SegmentedControl; Dialog, Drawer, NavSheet, Tabs, Disclosure, Faq and faqJsonLd on Base UI 1.9 where the platform falls short; Field, Fieldset, Form with the site's inline validation, ErrorSummary, Callout, Honeypot, FormTimestamp and QuoteForm; PrefsScript under 1 KB, usePref and setPref with cross-tab sync, ThemeToggle and the visitor VolumeDial; VisuallyHidden.