<button> element is styled by default. Use data-variant attributes for semantic variants and classes for visual styles.
Variants
Buttons support multiple semantic variants using thedata-variant attribute.
Primary
The default button style with primary brand color.Secondary
Usedata-variant="secondary" for secondary actions.
Danger
Usedata-variant="danger" for destructive actions.
Outline
Use the.outline class for buttons with transparent backgrounds.
Ghost
Use the.ghost class for minimal buttons without borders.
Sizes
Buttons support three sizes: small, default, and large.Small
Use the.small class for compact buttons.
Large
Use the.large class for prominent buttons.
As Link
Add the.button class to anchor tags to style them as buttons.
Button Group
Wrap buttons in<menu class="buttons"> to create connected button groups.
States
Disabled
Use thedisabled attribute to disable buttons.
CSS Classes
Semantic variant:
secondary, dangerVisual styles:
small, large, outline, ghost, iconStyling
Buttons use CSS custom properties for theming:--primary- Primary button background--primary-foreground- Primary button text color--secondary- Secondary button background--secondary-foreground- Secondary button text color--danger- Danger button background--danger-foreground- Danger button text color--accent- Hover state for outline/ghost buttons--border- Border color for outline buttons--radius-medium- Button border radius--transition-fast- Transition duration