Skip to content

Button

Buttons trigger actions or navigate to new pages.

Examples

Basic Usage

Sizes

Disabled State

API

Props

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'default''default'Button style variant
size'small' | 'medium' | 'large''medium'Button size
disabledbooleanfalseDisable button interaction
type'button' | 'submit' | 'reset''button'HTML button type

Events

EventPayloadDescription
clickMouseEventEmitted when button is clicked

Slots

SlotDescription
defaultButton content
iconOptional icon slot

Accessibility

  • Uses semantic <button> element
  • Supports keyboard navigation
  • Includes proper ARIA attributes
  • Focus indicators meet WCAG standards

Best Practices

  1. Clear Labels: Use descriptive text that explains the action
  2. Consistent Styling: Use the same variant for similar actions
  3. Loading States: Show loading indicator for async actions
  4. Error Handling: Provide feedback when actions fail