Button
Displays a button or a component that looks like a button.
Examples
Regular
Preview
Emphasis
Preview
Error
Preview
Warning
Preview
Success
Preview
Outlined
Preview
Gradient
Preview
Medbrain
Preview
Sizes
Preview
With Icon
Preview
With Badge
Preview
1
2
3
4
5
With Alert
Preview
Loading
Preview
Disabled
Preview
API
| Property | Type | Possible values | Default | Description |
|---|---|---|---|---|
| variant | ”regular” | “regular-soft” | “regular-basic” | “emphasis” | “emphasis-soft” | “emphasis-basic” | “error” | “error-soft” | “error-basic” | “warning” | “warning-soft” | “warning-basic” | “success” | “success-soft” | “success-basic” | “outlined” | “gradient” | “medbrain" | "regular”, “regular-soft”, “regular-basic”, “emphasis”, “emphasis-soft”, “emphasis-basic”, “error”, “error-soft”, “error-basic”, “warning”, “warning-soft”, “warning-basic”, “success”, “success-soft”, “success-basic”, “outlined”, “gradient”, “medbrain" | "regular” | Sets the visual style of the button. |
| size | ”sm” | “md” | “lg” | “xl" | "sm”, “md”, “lg”, “xl" | "md” | Sets the size of the button. |
| asChild | boolean | true, false | false | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| containerClassName | string | - | - | Class name for the container element. |
| iconLeft | React.ReactElement | - | - | Icon displayed to the left of the button content. |
| iconRight | React.ReactElement | - | - | Icon displayed to the right of the button content. |
| badge | number | string | - | - | Shows a badge with the specified value in the top-right corner of the button. |
| loading | boolean | true, false | false | Shows a loading indicator and disables the button. |
| alert | string (color) | - | - | Shows an animated alert circle with the specified color to the left of the button content. |
| disabled | boolean | true, false | false | Disables the button (inherited from button). |
| …props | All native button props | - | - | Allows passing any other standard properties of a button element. |
Last updated on