Primitives
Primitive

Button

Clickable button with various styles and sizes

Buttons trigger an action or event: submitting a form, opening a dialog, or confirming a choice. Use them for in-page actions, not for navigation between pages.

Preview

Installation

Usage

Examples

Variants

Use variant to change the button's visual weight and color.

VariantDescription
primaryThe default, highest-emphasis action.
primary-softA tinted primary for a lower-emphasis branded action.
neutralA solid neutral action with no brand color.
secondaryThe standard lower-emphasis action.
outlineA bordered action for secondary actions.
ghostA borderless action for toolbars and dense UI.
linkRenders as inline text, like a link.
destructiveA destructive action such as delete.
destructive-softA tinted destructive for a lower-emphasis warning.

Sizes

Use size to set the button's height and padding.

With Icons

Use leftSection and rightSection to place an icon beside the label.

Use the render prop to render as a Next.js Link, and set nativeButton to false.

Accessibility

Label icon-only buttons

An icon-only button has no text for a screen reader to announce. Give it an aria-label describing the action.

Loading state

The loading prop disables the button but keeps it focusable (focusableWhenDisabled), so keyboard users don't lose their place while an action is in flight.

API Reference

The Button component is built on top of Base UI's Button. All Base UI props are supported. The documentation below only covers custom props and modified defaults specific to our implementation.

For the complete Base UI API, see the Base UI Button documentation.

Props

Button

Clickable element that triggers actions. Wraps Base UI's Button.

Prop