Button

Versatile button with variants, sizes, loading state, and icon support.

Installation

Installs the Base UI flavor. Switch in the right panel.

Variants

Inspect

Sizes

Inspect

With Icons

Inspect

Single-line icon and label

Icon and label stay together in a horizontal, non-wrapping row. Both icon props and inline SVG children are supported, including compact and loading states. When a toolbar gets narrow, wrap or scroll whole controls rather than stacking an icon above its label. Use an explicitly named icon-only action when the product calls for one.

Inspect

Loading & Disabled

Inspect

API Reference

PropTypeDefaultDescription
variant"primary" | "secondary" | "tertiary" | "ghost""primary"Visual style of the button.
size"sm" | "md" | "lg" | "icon-sm" | "icon" | "icon-lg""md"Size of the button.
loadingbooleanfalseShows a spinner and disables the button.
leadingIconIconComponent—Icon displayed before the label.
trailingIconIconComponent—Icon displayed after the label.
asChildbooleanfalseMerge props onto the child element instead of rendering a <button>.
disabledbooleanfalseDisables the button.