Skip to content
GitHub (opens in a new tab)

IconButton

Icon-only kit Button: a square action with an icon and a required accessible name.

stableAtomcontracts/iconbutton.json

Preview

IconButton

A kit Button with an icon and no label. It is a typed export of Button, so it looks the same and takes the same appearance, mode and size. The icon and ariaLabel are required.

Master

An invoice toolbar: Download, More and Add invoice.

Usage

Each IconButton has an ariaLabel that names the action. Join related icon actions in a ButtonGroup. When the icon alone could be misread, use a Button with a label.

Do's

  • A toolbar or row action where the icon is enough, like Download, More or Add
  • A compact action beside a field or a title, where a label would not fit
  • Icon actions joined in a ButtonGroup

Don'ts

  • The action needs a visible label — use Button with iconStart
  • The icon alone could be misread — use Button with a label
  • Navigation to another page — use Link
  • A main action with a menu of other actions — use SplitButton
<ButtonGroup ariaLabel="Invoice actions">
  <IconButton appearance="outline" mode="neutral" icon="Download" ariaLabel="Download" />
  <IconButton appearance="outline" mode="neutral" icon="Ellipsis" ariaLabel="More" />
  <IconButton appearance="outline" mode="neutral" icon="Plus" ariaLabel="Add invoice" />
</ButtonGroup>

When to use

  • A toolbar or row action where the icon is enough, like Download, More or Add
  • A compact action beside a field or a title, where a label would not fit
  • Icon actions joined in a ButtonGroup

When not to use

  • The action needs a visible label — use Button with iconStart
  • The icon alone could be misread — use Button with a label
  • Navigation to another page — use Link
  • A main action with a menu of other actions — use SplitButton

What an agent reads

import { IconButton } from "agentic-ds-kit";
must
  • ariaLabel is required and names the action
  • The icon is aria-hidden
  • Add a kit Tooltip with the same words when the icon is not obvious
  • Everything else follows Button
defaults
  • size md
  • appearance solid
  • mode primary
  • flat false
  • shape default
  • disabled false
  • loading false
  • type button
stops if
  • Do not build a local icon button — IconButton renders the kit Button, so it has no look of its own
  • Do not ship without ariaLabel
  • Do not pass custom SVG markup — use a Lucide name or Lucide component
  • Do not use more than one appearance=solid mode=primary IconButton or Button in a view
  • Do not use raw hex

From contracts/iconbutton.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
iconKitIconYes—A curated Lucide name (PascalCase or kebab-case), a Lucide component, or an element. Same rules as Button iconStart.
ariaLabelstringYes—Names the action, like Download. There is no visible label.
sizelg | md | smNomdA square of control-height: sm 32, md 36, lg 40. The same height as a labelled Button, Input and Select of that size.
appearancesolid | outline | soft | ghostNosolidSame as Button. Toolbars usually use outline or ghost with mode neutral.
modeprimary | neutral | dangerNoprimary—
flatbooleanNofalse—
shapedefault | pillNodefault—
disabledbooleanNofalse—
loadingbooleanNofalseSame as Button loading. The spinner takes the place of the icon.
onClickfunctionNo——
typebutton | submit | resetNobutton—
  • Component
    →

    Button

    Clickable action control with appearance × mode (plus an optional flat set) and a fixed set of sizes.

  • Component
    →

    Link

    Text that navigates to another page or place: inline inside a sentence, standalone on its own line, or an announcement chip, with an external variant that opens a new tab.

  • Component
    →

    SplitButton

    A main action joined to a chevron that opens a menu of related actions.