Skip to main content

Button

Trigger actions with a single click, built on Base UI.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
iconReactNode-
iconPositionleading | trailingleadingWhich end icon sits at.
Which end icon sits at.
iconOnlybooleanfalse
holdboolean | numberfalse
holdLabelstring-What the button says for a moment once a hold completes.
What the button says for a moment once a hold completes.
onHold() => void-
countdownboolean | numberfalse
countdownLabelstringUndoWhat the button says while the countdown runs, beside the seconds left.
What the button says while the countdown runs, beside the seconds left.
onCountdown() => void-
variantprimary | secondary | subtle | ghost | danger | linkprimary
sizesm | md | lgmd
shapesquare | rounded | squircle | pillrounded
disabledbooleanfalseBlocks interaction and dims the button.
Blocks interaction and dims the button.
loadingbooleanfalseSwaps the icon for a spinner, dims the button and blocks interaction, while leaving it focusable: aria-busy and aria-disabled rather than the native disabled attribute, which would drop the control out of the tab order while a reader is waiting on it.
Swaps the icon for a spinner, dims the button and blocks interaction, while leaving it focusable: aria-busy and aria-disabled rather than the native disabled attribute, which would drop the control out of the tab order while a reader is waiting on it.
transitionbooleantrue
focusboolean | stringtrue