Button
The primary action control.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
- Use it when Trigger an action — submit, save, confirm, open. Exactly one
accentbutton per view as the primary action. - Reach for something else when Navigating to another page (use a link), or toggling a single setting (use
Switch).
Accessibility
Operable with Enter and Space; isLoading sets aria-busy and blocks activation. Icon-only? Use IconButton with an aria-label. The focus ring (--focus-ring) must stay visible.
Install and import
npx shadcn@latest add @prism/button
import { Button } from '@/components/prism/Button';
In a no-build prototype, read it from the bundle instead: const { Button } = window.PrismDesignSystem_39d121;
Examples
Primary + semantic
<Button variant="accent">Save changes</Button>
<Button variant="positive">Approve</Button>
<Button variant="negative">Delete</Button>
Sizes
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>
<Button size="xl">XL · TV</Button>
With icon + loading
<Button icon={<RefreshCw />} isLoading={saving} onPress={save}>
{saving ? "Saving…" : "Save"}
</Button>
Props
| Prop | Type | Required | Description |
|---|---|---|---|
variant | "accent" | "neutral" | "quiet" | "outline" | "negative" | "negative-outline" | "positive" | "notice" | "prompt" | — | Visual emphasis. accent is the single primary action per view; positive/notice/negative are semantic confirm/caution/destructive fills. prompt is an opener that looks like the field it opens ("What's on your mind?"): full width, start-aligned, input surface, muted text. |
size | "sm" | "md" | "lg" | "xl" | — | Control height. xl is for TV / remote-friendly surfaces. |
type | "button" | "submit" | "reset" | — | |
isDisabled | boolean | — | |
isLoading | boolean | — | Shows an in-button spinner, sets aria-busy and blocks interaction. |
fullWidth | boolean | — | |
isTruncated | boolean | — | Ellipsise a long label (e.g. a file name in a table cell) within the available width; a string label becomes the tooltip. |
printHidden | boolean | — | Leave the button off paper when the page is printed (sets data-print="hide"). |
icon | React.ReactNode | — | Leading icon node (e.g. a Lucide <svg>). Replaced by the spinner while loading. |
iconEnd | React.ReactNode | — | Trailing icon node. |
onPress | (e: React.MouseEvent<HTMLButtonElement>) => void | — | |
onClick | (e: React.MouseEvent<HTMLButtonElement>) => void | — | |
children | React.ReactNode | — | |
className | string | — |