Skip to main content

Button

The primary action control.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

  • Use it when Trigger an action — submit, save, confirm, open. Exactly one accent button 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​

PropTypeRequiredDescription
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"—
isDisabledboolean—
isLoadingboolean—Shows an in-button spinner, sets aria-busy and blocks interaction.
fullWidthboolean—
isTruncatedboolean—Ellipsise a long label (e.g. a file name in a table cell) within the available width; a string label becomes the tooltip.
printHiddenboolean—Leave the button off paper when the page is printed (sets data-print="hide").
iconReact.ReactNode—Leading icon node (e.g. a Lucide <svg>). Replaced by the spinner while loading.
iconEndReact.ReactNode—Trailing icon node.
onPress(e: React.MouseEvent&lt;HTMLButtonElement&gt;) =&gt; void—
onClick(e: React.MouseEvent&lt;HTMLButtonElement&gt;) =&gt; void—
childrenReact.ReactNode—
classNamestring—