variant parameter signals what kind of action the button performs, while size controls its dimensions.
Basic Usage
The label can be passed as a positional argument or as a keyword (label="Save Changes").
Variants
Each variant communicates a different intent to the user:Sizes
With Icons
Buttons accept anicon prop (any lucide icon name in kebab-case). The icon renders before the label text.
Icon Sizes
Square buttons optimized for single icons. Useicon with an icon-size variant for icon-only buttons.
Button Type
Inside aForm, buttons default to type="submit", which triggers form submission on click. Set button_type="button" for actions that should not submit the form, like cancel or close buttons.
"submit" (default in forms), "button" (no form behavior), and "reset" (clears the form).
Disabled State
Custom Styling
Every component acceptscss_class for additional Tailwind CSS classes. When your classes target the same CSS property as a built-in style (like rounded-full vs the default rounded-md), the built-in class is automatically removed so your override wins cleanly:
API Reference
Button Parameters
Button text. Can be passed as a positional argument.
Lucide icon name in kebab-case (e.g.,
"arrow-right", "trash-2"). Browse icons at lucide.dev/icons.Visual style:
"default", "destructive", "outline", "secondary", "ghost", "link", "success", "warning", "info".Button dimensions:
"default", "xs", "sm", "lg", "icon", "icon-xs", "icon-sm", "icon-lg".HTML button type:
"submit" (default in forms), "button" (no form submit), or "reset". Use "button" for cancel/close actions inside a Form.Whether the button is non-interactive. Accepts a template expression like
"{{ not $item.name }}" for conditional disabling.Additional Tailwind CSS classes appended to the component’s built-in styles.
Protocol Reference
Button