Button
Triggers a click action usually performed by the user to trigger an event such as submitting a form or closing a dialog.
Button Props
Prop | Type | Default |
---|---|---|
variant | "solid" | "outline" | "ghost" | "text" | "solid" |
color | "accent" | "danger" | "neutral" | "success" | "accent" |
size | "small" | "normal" | "normal" |
disabled | boolean | false |
loading | boolean | - |
loaderText | ReactNode | - |
leadingIcon | ReactNode | - |
trailingIcon | ReactNode | - |
maxWidth | string | number | - |
width | string | number | - |
asChild | boolean | - |
className | string | - |
Examples
Variant
Variants allow you to customize the button's style, making it visually distinctive and suitable for different purposes. Default is solid
.
Color
Colors help convey the purpose and importance of actions. The color prop only affects solid and outline variants. Default is accent
.
Size
The Button component offers two size options. Default size is normal
.
Disabled
The Button component provides a "disabled" state, which prevents the button from responding to any user actions. Default is false
.
Loading
The Button component offers inbuilt loading states. Loading state is used to signify an ongoing process after the user has clicked on the button.
With leading and trailing icons
The button component accepts optional leading and/or trailing icons.