An icon-only button in the theme’s button shape
For actions where a label is not needed, like close, menu, or navigation arrows. Uses the same two props as Button: variant for the emphasis (primary, secondary, tertiary) and tone for the colour (default, neutral or destructive). Good for toolbars and compact UI where space is tight.
Primary
Secondary
Tertiary
Primary, neutral
A solid grey fill that stays visible at rest, unlike the transparent tertiary, with a button's full shape and no accent colour.
Secondary, neutral
The outlined shape with a grey edge in place of the accent, for utility controls such as toolbar actions and a notification bell. Hover and press fill it with the neutral greys.
Primary, destructive
The filled button in the danger colour, for the one irreversible action a surface leads with.
Secondary, destructive
For dangerous or irreversible actions like delete. The outline and icon take the danger colour, and hover and press fill with it.
Tooltip
An icon-only control names itself: every icon button shows a tooltip with its accessible label on hover and focus. Pass tooltip a string for different wording, false to opt out when the host labels the control another way, and tooltipPosition to pick the side when an edge would clip the default placement above.
Loading
Set loading while an async action runs. The spinner replaces the icon in the variant’s own colour and interaction is blocked, without the dimmed disabled look.
Glass
Set glass when the button sits on a busy ground, such as a map, a chart or a shader scene, as a notification bell in a template’s top bar does. It is Button’s glass on the icon-only form: the ground behind it is blurred, an outlined or ghost button takes the glass fill at rest, and a filled one lets a little of the ground through its colour. Hover and press are each variant’s own.
Compact
Alternatives
- Use Button instead when the action needs its words on show, with or without an icon beside them.
- Use Copy button instead when the button puts a value on the clipboard and should confirm it.
Props
Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.
| Prop | Type | Default | Description |
|---|---|---|---|
icon* | string | ReactNode | The icon — Material Symbol name (string) or custom element (ReactNode) | |
variant | "neutral" | "primary" | "secondary" | "tertiary" | Emphasis: `primary` (filled), `secondary` (outlined) or `tertiary`
(ghost). The colour is `tone`'s job. `neutral` is the legacy value from
before the split and renders as `variant="primary" tone="neutral"`. | |
tone | "default" | "destructive" | "neutral" | Colour, independent of emphasis: `default` carries the action colour,
`neutral` the greys, `destructive` the danger colour. Tertiary is
already grey, so `neutral` leaves it unchanged; a tertiary
`destructive` takes the outlined look, since a danger action needs a
visible edge. | |
priority | "primary" | "secondary" | "tertiary" | Legacy alias for `variant`. Deprecated: Use `variant` instead. | |
disabled | boolean | Whether the button is disabled | |
state | "default" | "active" | "disabled" | "hover" | Documentation-only interaction state. Deprecated: Use `disabled` for the disabled state.
Documentation-only affordance for rendering a *static* interaction state in
Storybook and the showcase site. Real hover/active styling comes from CSS
pseudo-classes and needs no prop — for docs, prefer
`className="ds-icon-button--hover"`. | |
size | "default" | "compact" | 'default' | Button size |
loading | boolean | Shows a spinner in place of the icon and blocks interaction while an
async action runs. Keeps the variant's full-colour appearance (unlike
the disabled state) and sets `aria-busy` on the rendered element. | |
glass | boolean | Frosts the button for a busy ground (a shader, a photo, a map), as
Button's `glass` does: the page behind it is blurred, an outlined or
ghost button takes the glass fill at rest and a filled one lets a
little of the ground through its colour. Hover and press are the
variant's own. Works on every `variant` and `tone`. | |
label* | string | The button's name: what a screen reader announces and, by default, what
the tooltip shows. Required, because the button has no visible text.
Named as Button's and AiButton's text is, so the family spells it one way. | |
tooltip | string | false | The hover/focus tooltip. An icon-only control names itself: by default
the button wears a Tooltip carrying `label`. Pass a string to show
different wording, or `false` to opt out — for a host that labels the
control another way, or one that owns the button's box directly
(SplitButton's trigger stretches to its sibling segment, which the
tooltip wrapper would block). | |
tooltipPosition | "top" | "bottom" | "left" | "right" | "start" | "end" | 'top' | Which side the tooltip opens on. `start` and `end` follow the reading direction. |
type | "button" | "submit" | "reset" | 'button' | The button's native type. Defaults to `button`, so a button inside a form
never submits it by accident; set `submit` on the form's submit button, or
`reset`. Ignored when `href` renders a link. |
href | string | Optional href — renders as <a> instead of <button> | |
target | string | Optional target attribute for links | |
rel | string | Optional rel attribute for links | |
badge | string | number | true | A mark on the button's top-end corner, as BottomNav draws one: a count (a notification bell's unread), or `true` for a dot with no number. | |
badgeMax | number | 99 | The highest count the badge spells out; a larger one reads "99+". Defaults to 99. |
badgeLabel | ((badge: string | number | true) => string) | (badge: number | string | true) => (badge === true ? ', new' : `, ${badge} new`) | Text read after `label` while the button carries a badge, given the
badge. Defaults to ", new" for a dot and ", 3 new" for a count; the
leading comma and space are part of the text. The tooltip keeps
`label` alone. |
locale | string | 'en-US' | The BCP 47 locale a numeric badge is written in, such as `ar-EG`. Defaults to `en-US`. This component can render from a Server Component, so it takes the prop alone and reads no LocaleProvider. |
className | string | '' | Additional CSS classes |
linkComponent | LinkComponent | The component the link renders with, such as Next.js's `Link`, so it
navigates through the app's router; a plain `<a>` when unset. This
component can render on the server, so it never reads a LinkProvider:
pass the prop even under one. |
Tested keys
An automated test presses every row below, in a left-to-right and a right-to-left layout.
Icon button follows the WAI-ARIA button pattern.
| Key | What it does |
|---|---|
Enter | Activates the button. |
Space | Activates the button. |
// From the npm package
import { IconButton } from 'rift-ds/components/IconButton/IconButton';
// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/icon-button.json4.4 kB gzipped, with everything it imports. Peer dependencies are not counted.
For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.