IconButton
A square, icon-only button. Always give it an aria-label.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
- Use it when A compact, icon-only action where space is tight (toolbars, table rows, cards).
- Reach for something else when Primary or ambiguous actions — if the meaning isn’t universally obvious, use a labelled
Button.
Accessibility
Requires an aria-label — there is no visible text. Keyboard activated with Enter/Space.
Install and import
npx shadcn@latest add @prism/icon-button
import { IconButton } from '@/components/prism/IconButton';
In a no-build prototype, read it from the bundle instead: const { IconButton } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
type | "button" | "submit" | "reset" | — | "button" (default), "submit" to submit its form, or "reset". |
variant | "quiet" | "neutral" | "accent" | "negative" | "negative-quiet" | — | quiet (default), neutral, accent, or a destructive one so delete / remove never looks harmless: negative-quiet (red icon, no fill — e.g. a remove button on every row) or negative (red fill). |
size | "sm" | "md" | "lg" | — | |
shape | "square" | "round" | — | square (rounded-rect, default) or round (circular). |
isDisabled | boolean | — | |
onPress | (e: React.MouseEvent<HTMLButtonElement>) => void | — | REQUIRED for accessibility — describes the action. |
onClick | (e: React.MouseEvent<HTMLButtonElement>) => void | — | |
children | React.ReactNode | — | The icon node. |
className | string | — |