|Kit

ActionIcon

Polymorphic

Square, icon-only sibling of Button. Same (variant × color) model and pressed (toggle) state, plus its own radius scale.

ActionIcon is the icon-only counterpart to Button. It shares the same orthogonal (variant × color) model and adds its own radius scale so circular triggers (toolbars, like buttons, dismiss controls) drop straight in.

import { ActionIcon } from "@42-central/ui-react/action-icon";
import { Settings } from "lucide-react";

<ActionIcon aria-label="Open settings">
  <Settings />
</ActionIcon>;

The icon is auto-sized by the parent's size variant: drop in a bare lucide-react icon. To size one icon differently, put a size class on it (<Star className="size-5" />); Lucide's size={n} prop is only an HTML attribute and loses to the variant.

aria-label is required. The icon children are decoration — screen readers won't announce them. Without a label, the trigger is effectively invisible to assistive tech.

Playground

Component

Loading preview

Props

Code

<Component
  variant="default"
  color="brand"
  size="md"
/>

Variants

Five visual treatments, identical in semantics to Button's. Each reads off the same color slots (--c-solid, --c-soft, --c-text) so palette swaps are uniform.

Code

import { Star } from 'lucide-react';

<ActionIcon variant="filled"  aria-label="Star"><Star /></ActionIcon>
<ActionIcon variant="light"   aria-label="Star"><Star /></ActionIcon>
<ActionIcon variant="outline" aria-label="Star"><Star /></ActionIcon>
<ActionIcon variant="subtle"  aria-label="Star"><Star /></ActionIcon>
<ActionIcon variant="default" aria-label="Star"><Star /></ActionIcon>

subtle remains the toolbar workhorse: borderless, no resting fill, hover tint reveals the palette.

Colors

Every variant (except default) accepts any color from the shared palette.

Code

<ActionIcon variant="filled"  color="brand" aria-label="Favorite"><Heart /></ActionIcon>
<ActionIcon variant="light"   color="blue"  aria-label="Info"><Star /></ActionIcon>
<ActionIcon variant="outline" color="teal"  aria-label="Toggle"><Star /></ActionIcon>
<ActionIcon variant="subtle"  color="neutral"  aria-label="Bold"><Bold /></ActionIcon>
<ActionIcon variant="filled"  color="red"   aria-label="Delete"><Trash2 /></ActionIcon>

For destructive triggers, use variant="filled" color="red" — there is no separate destructive variant.

Sizes

Five sizes from xs (compact toolbar) to xl (hero CTA). Each is square, and its icon is 12 / 14 / 16 / 20 / 24px, the same as a Button of that size, so an icon-only control and a labelled one line up in a toolbar.

Code

<ActionIcon size="xs" aria-label="Star"><Star /></ActionIcon>
<ActionIcon size="sm" aria-label="Star"><Star /></ActionIcon>
<ActionIcon size="md" aria-label="Star"><Star /></ActionIcon>
<ActionIcon size="lg" aria-label="Star"><Star /></ActionIcon>
<ActionIcon size="xl" aria-label="Star"><Star /></ActionIcon>

A different icon size

To size one icon differently, put a size class on the icon itself: it wins over the size variant. Lucide's size={n} prop does not, since it is only an HTML attribute and any CSS rule outranks it.

Code

<ActionIcon size="md" aria-label="Star"><Star /></ActionIcon>
<ActionIcon size="md" aria-label="Star"><Star className="size-5" /></ActionIcon>
<ActionIcon size="md" aria-label="Star"><Star className="size-6" /></ActionIcon>

Radius

Independent radius scale, including full for circular triggers — perfect for FABs, like buttons, and avatar-adjacent controls.

Code

<ActionIcon radius="xs" aria-label="Radius xs"><Star /></ActionIcon>
<ActionIcon radius="sm" aria-label="Radius sm"><Star /></ActionIcon>
<ActionIcon radius="md" aria-label="Radius md"><Star /></ActionIcon>
<ActionIcon radius="lg" aria-label="Radius lg"><Star /></ActionIcon>
<ActionIcon radius="xl" aria-label="Radius xl"><Star /></ActionIcon>
<ActionIcon radius="full" aria-label="Radius full"><Plus /></ActionIcon>

Loading

The icon is swapped for an inline spinner, the element is marked aria-busy="true", and pointer events are suppressed. The accessible name still comes from aria-label — screen readers will announce both the label and the busy state.

Code

import { Star } from 'lucide-react';

const [pending, startTransition] = useTransition();

<ActionIcon
  color="brand"
  loading={pending}
  aria-label="Star repository"
  onClick={() => startTransition(toggleStar)}
>
  <Star />
</ActionIcon>

Toolbar pattern

A row of subtle ActionIcons with radius="md" is the workhorse for editor toolbars and table row actions.

Code

import { Bold, Code, Italic, Link2, Underline } from 'lucide-react';

<div role="toolbar" aria-label="Format">
  <ActionIcon variant="subtle" color="neutral" size="sm" aria-label="Bold"><Bold /></ActionIcon>
  <ActionIcon variant="subtle" color="neutral" size="sm" aria-label="Italic"><Italic /></ActionIcon>
  <ActionIcon variant="subtle" color="neutral" size="sm" aria-label="Underline"><Underline /></ActionIcon>
</div>

Toggle

Bold, pin, mute: an icon that stays pressed. The same props as Button's toggle — pressed, defaultPressed, onPressedChange — make the ActionIcon a toggle button with aria-pressed, and swap its look from variant to pressedVariant. On a toggle these default to light and filled, the pair an ActionIcon gets inside a ButtonMultiSelect, so both look the same.

Code

<ActionIcon defaultPressed={false} aria-label="Pin"><Pin /></ActionIcon>
<ActionIcon defaultPressed color="brand" aria-label="Favorite"><Heart /></ActionIcon>
<ActionIcon defaultPressed color="brand" radius="full" aria-label="Favorite"><Heart /></ActionIcon>

In a toolbar, a quieter pair reads better. Each toggle below holds its own state:

Code

<div role="toolbar" aria-label="Format">
  <ActionIcon variant="subtle" pressedVariant="light" color="neutral" size="sm" defaultPressed aria-label="Bold"><Bold /></ActionIcon>
  <ActionIcon variant="subtle" pressedVariant="light" color="neutral" size="sm" defaultPressed={false} aria-label="Italic"><Italic /></ActionIcon>
  <ActionIcon variant="subtle" pressedVariant="light" color="neutral" size="sm" defaultPressed={false} aria-label="Underline"><Underline /></ActionIcon>
</div>

loading and disabled block the flip and keep the pressed look, and the aria-label stays the same in both states: aria-pressed carries the state. When the toggles belong together and you want arrow-key navigation between them, use ButtonMultiSelect instead. A toggle is never a link: an asChild link ignores the pressed props, see Button.

Polymorphic with asChild

Same Ark UI polymorphism as Button. Wrap a link to keep client-side navigation while inheriting the icon-button styling.

import Link from "next/link";
import { User } from "lucide-react";

<ActionIcon asChild variant="subtle" color="neutral" aria-label="Open profile">
  <Link href="/profile">
    <User />
  </Link>
</ActionIcon>;

Code

<ActionIcon asChild variant="subtle" color="neutral" aria-label="Open profile">
  <a href="/profile"><User /></a>
</ActionIcon>
<ActionIcon asChild color="teal" loading aria-label="Star repository">
  <a href="#"><Star /></a>
</ActionIcon>

loading swaps the icon for a spinner here too — Ark's asChild only lets a single element through, so the spinner replaces the rendered child's own children rather than the child itself, same as Button's startSlot/endSlot. The click stays blocked while loading, same as everywhere else.

API

Prop

Type

All other props are forwarded to the underlying button (or asChild element).

When to use which

  • Reach for Button when the trigger has a visible text label, with or without supporting icons.
  • Reach for ActionIcon when the trigger is icon-only and the meaning lives in aria-label + tooltip.
  • For an icon plus a text label, use Button with startSlot / endSlot — not ActionIcon.

Changelog

v0.30.0
  • href on Button and ActionIcon is now a type error, including through a spread; wrap a link with asChild instead

    #483
  • New toggle state: pressed, defaultPressed, onPressedChange and pressedVariant (light unpressed, filled pressed by default)

    #483
v0.28.0
  • Button and ActionIcon read their own --btn-* slots in colors.css; overriding --c-* no longer restyles them

    #458
  • Colors follow the Figma V3 Button set, and every palette's hover steps up the way neutral's does

    #458
  • Disabled uses the palette's tints instead of 50% opacity

    #458
  • Default icons follow Button's scale, 12–24px (was 20–32px)

    #460
  • A size class on the icon (className="size-5") now wins over the component's default

    #460
v0.19.0
  • Spinner's accessible name comes from label, and label={null} takes it out of the accessibility tree, so loading Buttons and ActionIcons no longer expose an extra "Spinner" image

    #319
v0.6.0
  • With asChild, slots and the loading spinner stay visible, and the spinner dims correctly

    #79
v0.5.0
  • Match Button's typography and light variant border

    #58
v0.3.0
  • isLoading → loading on Button and ActionIcon

    #25
v0.0.1
  • ActionIcon: the icon-only button

On this page