Actions · Buttonstable
Button
Starts an action or moves a flow forward. Five variants, four sizes, and four colours; square, flat and token-driven.
Preview
#previewPick a variant, size and state; Show code opens the React and CSS below.
primary · secondary · tertiary · icon-only (accessibilityLabel="More actions")
deploy-actions.tsx
import { Button } from "@blade-ai/weft/components/button";
import { ArrowRightIcon, MoreIcon } from "@blade-ai/weft/components/icons";
export function DeployActions({ isDeploying, onDeploy }: Props) {
return (
<div className="actions">
<Button
variant="primary"
size="medium"
icon={ArrowRightIcon}
iconPosition="left"
isLoading={isDeploying}
onClick={onDeploy}
>
Deploy agent
</Button>
<Button variant="secondary" href="/runs/preview">Preview run</Button>
<Button variant="tertiary" type="reset">Cancel</Button>
<Button
variant="secondary" icon={MoreIcon} iconOnly
accessibilityLabel="More actions"
/>
</div>
);
}All states
#all-statesEvery variant and colour from the Button spec, each shown in Default, Hover, Focus, Pressed, Disabled and Loading.
Primary
Default
Hover
Focus
Pressed
Disabled
Loading
Secondary
Default
Hover
Focus
Pressed
Disabled
Loading
Tertiary
Default
Hover
Focus
Pressed
Disabled
Loading
Ghost
Default
Hover
Focus
Pressed
Disabled
Loading
Link
Default
Hover
Focus
Pressed
Disabled
Loading
Positive
Default
Hover
Focus
Pressed
Disabled
Loading
Negative
Default
Hover
Focus
Pressed
Disabled
Loading
White · on dark surfaces
Default
Hover
Focus
Pressed
Disabled
Loading
Icon-only
Default
Hover
Focus
Pressed
Disabled
Loading
Sizes
XSmall
Small
Medium
Large
Props
#propsBooleans are is-prefixed. children is required unless iconOnly.
Prop
Type
Default
Description
children *
string
—
Verb-first label; omit when iconOnly.
variant
"primary" | "secondary" | "tertiary" | "ghost" | "link"
"primary"
One primary per view.
color
"primary" | "white" | "positive" | "negative"
"primary"
positive / negative: primary + secondary only; white: primary, secondary, tertiary; ghost + link: primary only.
size
"xsmall" | "small" | "medium" | "large"
"medium"
Height 28 / 32 / 40 / 48px.
icon · iconPosition
IconComponent · "left" | "right"
"left"
Icon 12 / 14 / 16 / 16px, colour = label token. Both sides at once: UNDEFINED.
iconOnly
boolean
false
Square button. Rename to isIconOnly? UNDEFINED.
accessibilityLabel
string
—
Rendered as aria-label; required when iconOnly.
isDisabled · isLoading · isFullWidth
boolean
false
Disabled: native, opacity 50%. Loading: spinner, label hidden, width locked, aria-busy.
type
"button" | "submit" | "reset"
"button"
Ignored when href is set.
href
string
—
Renders <a href> (asChild) instead of <button>.
onClick
(event: MouseEvent) => void
—
Not fired while isDisabled or isLoading.
Usage
#usageShort rules for choosing and writing buttons.
Do
Use one primary button per view for the main action.
Start labels with a verb ("Deploy agent", "Create workspace").
Use isLoading for async actions instead of disabling the button.
Use color="negative" only for destructive actions, and confirm them.
Don't
Use a <button> to navigate or an <a> to run an action.
Ship an icon-only button without accessibilityLabel.
Add radius, shadows or raised edges; Weft is square and flat.
Hard-code colours; use the variant tokens.
Accessibility
#accessibilityNative <button> / <a> behaviour; no custom key handlers.
Keyboard
Key
Action
Tab / Shift+Tab
Moves focus to / from the button and shows the ring. Disabled buttons are skipped; loading buttons stay focusable.
Enter
Activates <button> and follows <a href>. Ignored while isLoading.
Space
Activates <button> on key-up. Does nothing on <a>.
Escape
No effect on Button (handled by the parent dialog or menu).
ARIA
Element
Role / attribute
When
<button>
native role button · type="button" · name = label
No href
<a href>
native role link · never role="button"
href set
aria-label
= accessibilityLabel
Required when iconOnly
aria-busy · aria-disabled
aria-busy="true" + aria-disabled="true"
isLoading. Live "Loading" announcement: UNDEFINED
disabled
native disabled attribute
isDisabled on <button>
icon · spinner <svg>
aria-hidden="true" · focusable="false"
Always
Agent Spec
#agent-specMachine-readable spec, tables (a)–(g). Same source as /specs/button.json and llms.txt.
PropertyValueToken
Height28 / 32 / 40 / 48size.28 / size.32 / size.40 / size.48
Padding-x10 / 14 / 20 / 24spacing.16 / spacing.17 / spacing.6 / spacing.7
Gap · icon6/8/8/8 · 12/14/16/16spacing.15 · spacing.3 · size.12 / 14 / 16
Label size / line12/16 · 13/20 · 13/20 · 14/20fonts.size.75 / 1200 / 100 · lineHeights.50 / 100
Radius · focus ring0 · 3pxborder.radius.none · border.width.3 + interactive.border.primary.faded
Min / max widthUNDEFINEDlong labels: truncate or wrap undecided