Skip to content

Button

Free

A button for an action on the page, such as Save or Delete. It has 9 looks and 5 sizes, and a spinner that keeps its width while the action runs.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Button renders a native <button>. Set busy while the action runs: the button keeps its width and its focus, and it blocks more clicks.

save-changes-button.tsx

Button

<button>
PropTypeDefaultDescription
glass"clear""dark""light"—
rounded"default""full"—
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs"—
variant"dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary"—
classNamestring—
busybooleanfalseThe button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading.
spinnerPlacement"center""start""center"center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label.
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.
  • Use it for an action on the page: submit, save, open, delete.
  • Set busy while the action runs. With the default spinnerPlacement, the button keeps its width and focus.
  • Use an icon size (icon, icon-sm) for an action with only an icon, and give it an aria-label.
  • To go to another page, use a link, not a button. Put buttonVariants on the link to give it the look of a button.
  • For a value that stays on or off, use a Switch.
EnterPresses the button.
SpacePresses the button.

Button is a Base UI Button, a native <button>. Its text is its name. An icon size (icon-xs, icon-sm, icon, icon-lg) has no text, so give it an aria-label.

With busy, the button sets aria-busy and blocks clicks, but it stays in the tab order and keeps focus. The label stays in the accessibility tree under the spinner, and the spinner is hidden from screen readers (aria-hidden).

The 3px focus ring shows on keyboard focus only (focus-visible). An invalid button (aria-invalid) shows a red ring.

On a coarse pointer, hit-area grows the touch target to at least 44 × 44px. The button keeps its size on the screen.

Press
press · 100ms · ease-out (0, 0, 0.2, 1) · moves down 1px
Loading
animate-spin · 1s · linear · repeats

Built with

Installs with Button

Components
Spinner
  1. AddedButton, with Spinner.
Open the release