Button
Buttons allow users to trigger actions with a single tap.
Installation
Usage
Props
Button
Extends Pressable
props.
Prop | Type | Default | Description |
---|---|---|---|
variant | 'default' | 'secondary' | 'accent-cool' | 'accent-warm' | 'base' | 'outline' | 'inverse' | 'default' | The visual style variant of the button. |
size | 'default' | 'sm' | 'lg' | 'big' | 'icon' | 'default' | The size variant of the button. |
startIcon | ReactNode | - | Icon element to display before the button content. |
endIcon | ReactNode | - | Icon element to display after the button content. |
disabled | boolean | false | When true, disables button interactions. |
className | string | - | Additional Tailwind classes to apply. |
Variants
Default (Primary)
Secondary
Accent Cool
Accent Warm
Base
Outline
Inverse
Sizes
Small
Default
Large
Big
Icon
With Icons
States
Buttons support various states through className props:
Hover
Active
Focus
Disabled
Interactive State
The Button component accepts a function as children to render content based on the press state:
Accessibility
The Button component:
- Uses
role="button"
for proper semantic structure - Supports keyboard navigation
- Maintains WCAG color contrast requirements
- Provides appropriate disabled states
- Includes clear, descriptive text labels