← All buttons

Core / Buttons

Icon Button

A compact action button whose content is an icon.

Preview

import { IconButton } from "@/components/ui/design-system/core/buttons/IconButton"

<IconButton aria-label="Add item"><Plus /></IconButton>

Installation

Full library

pnpm install:project /absolute/path/to/your-project

Manual install

The guided installer is the next library milestone. This component will be selectable as Core → Buttons → Icon Button.

Usage

<IconButton aria-label="Add item"><Plus /></IconButton>

Adopt to your project

Use className for local presentation. The element exposes data-slot, data-variant, and data-size selectors.

<IconButton aria-label="Add item" className="rounded-full px-6 shadow-sm"><Plus /></IconButton>

Accessibility

An icon-only control must have an aria-label. Pair unfamiliar icons with a Tooltip, but do not treat the tooltip as the only accessible name.

API reference

AttributeTypeDefaultRequiredPurpose
childrenReactNodeYesIcon content.
aria-labelstringYesAccessible name describing the action.
variant"primary" | "secondary" | "outline" | "ghost" | "destructive""ghost"NoSemantic action treatment.
size"sm" | "md" | "lg""md"NoControl size.
radius"sm" | "md" | "lg" | "xl" | "full""full"NoCorner treatment.
classNamestringNoLocal project styling.
...buttonPropsButtonHTMLAttributes<HTMLButtonElement>NoNative button attributes including disabled and onClick.