Skip to content

Button

Triggers an action. One primary button per view marks the action that matters most.

npx dtheo@latest add button

When to use

  • Submitting, saving, running, creating
  • Icon-only toolbar actions (with an aria-label)
  • Links that look like buttons, via render={<a />}
  • Navigation in running text: use a link
  • Toggling a persistent state: use Toggle or Switch

Examples

Sizes

xs · 22 pxTable rows
sm · 24 pxToolbars
md · 28 pxDefault, 36 px on touch
lg · 32 pxPage actions

Loading

Reruns the R-0412 step with Kp 3.60, Kd 0.09.

API

variant= 'secondary'
Visual weight. Use primary once per view.primarysecondaryoutlineghostdestructivelink
size= 'md'
Control height: 22, 24, 28 (36 on touch), 32px.xssmmdlgicon-xsicon-smiconicon-lg
loading= false
Shows a spinner, keeps the width, sets aria-busy.boolean
render
Render as another element, e.g. a link, keeping the styles and behavior.ReactElement

Other props pass through to Base UI’s Button.

Keyboard

EnterSpace
Activates the button
Tab
Moves focus to the next control
  • Icon-only buttons need an aria-label that names the action ("Delete run"), not the icon.
  • loading keeps the button focusable and sets aria-busy, so focus is not lost mid-action.
  • Disabled buttons are skipped by Tab; prefer explaining why an action is unavailable.

Used in