Displays a button or a component that looks like a button.
Loading demo: button-real-world
npx sdaia-ui@latest add button
import { Button } from '@/components/ui/Button';Use the `size` prop to change the size of the button.
Loading demo: button-size
The default button style.
Loading demo: button-primary
Use `variant="secondary-solid"` for secondary actions.
Loading demo: button-secondary-solid
Use `variant="secondary-outline"` for outlined secondary actions.
Loading demo: button-secondary-outline
Use variant="neutral" for high-contrast dark actions (Figma Style=Neutral).
Loading demo: button-neutral
Use `variant="subtle"` for low-emphasis inline actions.
Loading demo: button-subtle
Use variant="transparent" for link-style actions (Figma Style=Transparent).
Loading demo: button-transparent
Remember to add `leadingIcon` to include an icon before the label.
Loading demo: button-leading-icon
Renders a button with an icon and no text label.
Loading demo: button-icon-only
Use destructive={true} with any style (e.g. variant="primary" destructive). Matches Figma Destructive=True.
Loading demo: button-destructive
Props for the Button component.
Prop | Type | Default | Required |
|---|---|---|---|
variant | "neutral" | "primary" | "secondary-solid" | "secondary-outline" | "subtle" | "transparent" | "primary" | optional |
destructive | boolean | false | optional |
size | "sm" | "md" | "lg" | "md" | optional |
disabled | boolean | false | optional |
selected | boolean | false | optional |
iconOnly | boolean | false | optional |
leadingIcon | ReactNode | — | optional |
trailingIcon | ReactNode | — | optional |
fullWidth | boolean | false | optional |
as | ElementType | — | optional |
children | ReactNode | — | optional |
How this component behaves at the three system breakpoints. Spacing and type tokens switch automatically at 768px and 1280px.
| Screen | Behavior |
|---|---|
| Desktop (1280px and up) | Sized by its label. Use fullWidth to fill the container. |
| Tablet (768–1279px) | Same layout as desktop, with the tablet token values. |
| Phone (under 768px) | Same sizes with the mobile token values, so buttons get slightly smaller. Use fullWidth for the main action in narrow layouts, and size lg for touch where space allows. |