Overview
The Button component is a flexible, accessible button with support for multiple variants, colors, sizes, and icons.Basic Usage
- Code
- Preview
Variants
Filled (Default)
The default filled variant with solid background.- Code
- Preview
ButtonVariants
Border
Button with border and transparent background.- Code
- Preview
Plain
Minimal button with no background or border.- Code
- Preview
Sizes
Buttons come in three sizes: small (s), medium (m), and large (l).- Code
- Preview
With Icons
Add icons to your buttons using theicon prop.
- Code
- Preview
Icon Only Buttons
Create icon-only buttons by omitting the children.- Code
- Preview
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "filled" | "border" | "plain" | "filled" | Visual style variant |
| color | "primary" | "secondary" | "error" | "success" | "warning" | "primary" | Color theme |
| size | "s" | "m" | "l" | "m" | Button size |
| state | "rest" | "hover" | "pressed" | "focus" | "disabled" | "rest" | Button state |
| icon | React.ReactElement<React.SVGProps<SVGSVGElement>> | — | Icon element |
| selected | boolean | false | Selected state |
| disabled | boolean | false | Disabled state |
| className | string | "" | Additional CSS classes |