Skip to Content
ComponentsButton

Button

An interactive component that helps users perform clear actions. Built on Base UI Button  for keyboard accessibility and focus management.

Preview

Examples

Variant

Controls the visual emphasis level. Choose based on the importance of the action in context.

ValueDefaultDescription
solidFilled background. Use for the primary CTA that needs the most emphasis.
outlineBorder only. Use for secondary actions with less emphasis than solid.
ghostNo background or border. Use when minimal emphasis is needed.
weakSemi-transparent background. Pairs well with solid as a secondary action.

Size

Controls the button size. Choose based on context and required click area.

ValueDefaultDescription
smallFor tight spaces or secondary actions.
mediumMost versatile size.
largeFor primary CTAs or when a larger click area is needed.
xlargeFor high-visibility CTAs on large screens.

Intent

Expresses the semantic purpose of the button through color. Choose based on the nature of the action.

ValueDefaultDescription
primaryMain action for core app features.
secondarySecondary action to pair with primary.
successPositive outcomes: complete, save, confirm.
warningActions that require caution.
dangerIrreversible actions like delete or reset. Clearly warn the user.
neutralNeutral actions with no semantic emphasis.

Rounded

Controls the corner radius of the button.

ValueDefaultDescription
smallSmall corner radius
mediumDefault corner radius
largeLarge corner radius (pill-like)

Full width

When fullWidth is true, the button fills the full width of its parent container.

Disabled

Disables the button. When disabled, click events do not fire and the disabled style is applied.

Guidelines

Choosing variant

Choose the variant based on the importance of actions on the screen. Prefer a single solid button per view. Multiple solid buttons make it harder for users to identify the primary action.

  • solid → Single most important CTA on the screen
  • weak → Secondary action paired with solid
  • outline / ghost → Tertiary actions with low emphasis

Choosing intent

Use intent to convey the semantic nature of the action. For irreversible actions (delete, reset), always use danger to clearly warn the user.

  • Submit buttons: Unlike the native <button>, you must set type="submit" for the Button to act as a submit button in forms.
  • Links: Do not use Button for links. If a link should look like a button, style the <a> element directly.

Props

Props

Prop
Default
Type
variant?
"solid"
"solid" | "outline" | "ghost" | "weak"
size?
"medium"
"small" | "medium" | "large" | "xlarge"
intent?
"primary"
"primary" | "secondary" | "success" | "warning" | "danger" | "neutral"
rounded?
"medium"
"small" | "medium" | "large"
fullWidth?
false
boolean
disabled?
false
boolean
children?
ReactNode
Last updated on