Actions
Button
stableTriggers an action. Six variants, four sizes and a built-in pending state.
since v1.01.9 kB gzip
Preview
Pressed 0 times
Generated from controls
<Button onPress={deploy}>
Deploy preview
<ArrowRightIcon />
</Button>Installation
npx @strata/cli add buttonUsage
import { Button } from "@/components/strata";
export function SaveBar() {
return (
<div className="row gap-2">
<Button variant="outline">Cancel</Button>
<Button onPress={save}>Save changes</Button>
</div>
);
}Props
| Prop | Type | Default |
|---|---|---|
variantVisual weight of the button. | "solid" | "soft" | "outline" | "ghost" | "link" | "solid" |
sizeHeight, padding and icon size. | "xs" | "sm" | "md" | "lg" | "md" |
colorTone applied to the variant. | "brand" | "neutral" | "danger" | "success" | "brand" |
isPendingShows a spinner and blocks repeat presses. | boolean | false |
isDisabledPrevents interaction and dims the control. | boolean | false |
onPressFires on mouse, touch, keyboard and assistive-tech activation. | (e: PressEvent) => void | — |
classNameExtra Strata utilities, optionally derived from render state. | string | (state) => string | — |
Accessibility
Related
Was this page helpful?
Documented since v1.0 · components/button.mdx