Installation
CLI
Install the component using the StarUI CLI:
star add buttonExamples
Button Sizes
Different sizes including icon-only buttons
Buttons with Icons
Buttons enhanced with icons for better UX
Interactive Counter
Button that updates state on click
Clicked:
Toggle Visibility
Show/hide content with smooth transitions and dynamic button text
Form Integration
Button state controlled by form input
Button is disabled until you enter a name
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
Literal['default', 'secondary', 'destructive', 'outline', 'ghost', 'link'] |
'default' |
Button visual variant |
size |
Literal['default', 'sm', 'lg', 'icon'] |
'default' |
Button size |
disabled |
bool |
False |
Whether button is disabled |
cls |
str |
'' |
Additional CSS classes |