Button

A button or a component that looks like a button.

Usage

You can use the render prop to make another component look like a button. Here's an example of a link that looks like a button.

API Reference

This is a custom component built with a render-prop API.

Button

A button component with variant, size, and loading states.

When loading is true, the component:

  • Renders a spinner (data-slot="button-loading-indicator")
  • Adds data-loading on the button root
  • Forces the native disabled attribute
  • Sets aria-disabled="true"
  • Preserves button width by hiding content visually instead of unmounting it

Examples

Default

Outline

Secondary

Destructive

Success

Tertiary

Ghost

Extra-small Size

Small Size

Large Size

Extra-large Size

Disabled

Icon

Icon Small Size

Icon Large Size

With Icon

Loading (Built-in Prop)

Loading (Custom Composition)