AddThisFeature

Icon Button Pattern

Keep icon-only controls compact without making them guesswork.

moderate Components & Primitives

What it adds

A rule set for controls that show an icon and no label, covering naming, hit area, tooltips, and interaction states.

What your agent is told to do

5
  1. 1

    List every icon-only control in the app and give each one a written accessible name that describes the action, not the picture. Close dialog, not cross.

  2. 2

    Restrict icon-only treatment to actions whose meaning is genuinely conventional or whose context makes them obvious — a close, a menu, an overflow, a sort. Anything else gets a label.

  3. 3

    Size the icon and the hit area independently, so a sixteen pixel icon still sits inside a target large enough for a thumb, with the extra area coming from padding rather than from a larger glyph.

  4. 4

    Define hover, focus, active, disabled, and selected for every icon button, and make the selected state distinguishable from hover so a toggled control does not read as merely pointed at.

  5. 5

    Do not rely on a tooltip to carry the meaning. Tooltips never appear on touch, are slow on keyboard, and vanish for anyone using magnification — treat them as a reminder for people who already know.

Edge cases it handles

7
  • An icon button with no accessible name is announced as an unlabelled button, which makes the control unusable by anyone not looking at the screen.
  • Tooltips are unavailable on touch devices and delayed on keyboard focus, so any control whose only explanation is a tooltip is unlabelled for a large share of users.
  • The visible icon and the clickable area are different measurements. Enlarging the glyph to reach a comfortable target makes the interface shout; enlarging the padding does not.
  • Every interaction state must be defined explicitly, including the toggled-on state. A missing selected style leaves the user unable to tell whether the filter, the mute, or the pin is currently active.
  • Adjacent icon buttons in a toolbar need enough separation that their hit areas do not overlap, or users will activate the neighbour.
  • An icon whose meaning changes with state, such as play becoming pause, must change its accessible name at the same moment as its glyph.
  • Overflow menus triggered by an icon must remain reachable by keyboard and must return focus to the trigger when they close.

Definition of done

8
  • Every icon-only control has an accessible name describing its action.
  • No control depends on a tooltip to be understood.
  • Hit areas meet the minimum touch target while the icons stay at their intended visual size.
  • Hover, focus, active, disabled, and selected are each visually distinct.
  • Toggled controls announce and display their current state.
  • Adjacent icon buttons have non-overlapping hit areas.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.