Skip to content
HomeCobalt

Icon button

Names a button that is only an icon once, so the one string is read aloud by a screen reader and shown on hover as the tooltip.

Examples

Each label is read aloud and shown on hover; the eye stays pressed while the key shows.
Research API key
Ends in 42e8
With shortcutA reading queue's arrows say their keys after their names in the tooltip, "Next paper J", and the page answers the same keys from one map.

Liquidity terms in open-end real estate funds

Paper 1 of 3

In a cardA ghost button in the card's corner opens its menu.
Reading list
Papers you added this month.
  • Flood exposure in coastal mortgagesOct 14
  • Heat stress and regional outputOct 9
  • Carbon pricing and bank lendingSep 30
In a tableEach row keeps its most used action as an icon and puts the rest behind More actions, so the row never runs out of room.
FileActions
papers-retrieval.csv1,284 rows
advisers-2026-q3.csv312 rows
funds-by-domicile.csv96 rows

Variants

Guests
SecondaryThe grey fill, for an icon button standing alone with nothing to anchor it.

States

Empty the list before deleting it.

DisabledThe reason sits beside it; a disabled button has no tooltip.

Usage

Use it when

  • An action is known by its glyph and sits where a label would crowd: a bar, a row, a card corner, a table cell.
  • The same action repeats on every row or card, such as "More actions" or "Download".

Use something else when

  • The action is read, not recognised, or it is the view's primary action. Use Button with a text label instead.
  • The button stays pressed as a tool, such as bold. Use Toggle with aria-label and a Tooltip instead, or IconButton with aria-pressed when it is a per-item state such as a key shown in full.
  • The action is slow and must report itself. Use StateButton instead; a settling glyph has no label to hold its box.
  • The press navigates. Use a link styled with buttonVariants, or BackLink instead.
  • The press copies a value or saves a thing. Use CopyButton or SaveToggle instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/icon-button.json
import { IconButton } from "@/components/cobalt/ui/icon-button"