Button

Buttons allow users to perform actions and make choices with a single tap.

Import

Usage

Colors

Variants

Select a color:

Default

Bordered

Light

Ghost

Ethereal

Sizes

Radius

Shadowed

With Icons

Start Content

End Content

Icon Only

Loading

Disabled

Button Group

For more information about Button Groups, including colors, variants, sizes, and advanced usage, see the Button Group documentation.

Import

Custom Implementation

Custom Classes

Use className to apply custom Tailwind classes for wild and creative effects

Data Attributes

  • -
    data-slot="button"Main button element identifier
  • -
    data-slot="button-group"Button group container identifier

Accessibility

Keyboard Support

  • -
    SpaceActivates the button
  • -
    EnterActivates the button
  • -
    TabMoves focus to the next focusable element

ARIA Attributes

  • -
    aria-disabledSet when button is disabled
  • -
    aria-pressedSet when using the pressed prop for toggle buttons
  • -
    aria-labelRequired for icon-only buttons to provide context for screen readers
  • -
    role="group"Applied to ButtonGroup for proper grouping

Button Props

AttributeTypeDefaultDescription
variant'default' | 'bordered' | 'light' | 'ghost' | 'ethereal''default'The visual style variant of the button.
size'sm' | 'md' | 'lg''md'The size of the button.
color'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'lavender''default'The color scheme of the button.
radius'none' | 'sm' | 'md' | 'lg' | 'full''md'The border radius of the button.
loadingbooleanfalseWhether the button is in a loading state.
disabledbooleanfalseWhether the button is disabled.
startContentReactNode-Content to display before the button text (e.g., icons).
endContentReactNode-Content to display after the button text (e.g., icons).
iconOnlybooleanfalseWhether the button should be square-shaped for icon-only usage.
disableRipplebooleanfalseWhether to disable the ripple effect on button press.
shadowedbooleanfalseWhether to add a shadow to the button.
asChildbooleanfalseRender as a different element using Radix Slot.
pressedboolean-Sets the aria-pressed attribute for toggle buttons.
aria-labelstring-Accessible label for the button. Required for icon-only buttons.