Button
Variants: default, secondary, flat, success, danger, warning. Pass tooltip for a styled tooltip instead of the native title.
Children are laid out in a row with a gap, so an icon next to the text sits beside it: <Button><PlusIcon />New</Button>.
Tooltip text
Props
variant'default' | 'secondary' | 'flat' | 'success' | 'danger' | 'warning'Default:'default'Visual style.
tooltipstringShows a styled Tooltip (use instead of the native
title).tooltipPlacementstringDefault:'bottom'Tooltip placement (see Tooltip).
onClick(event) => voidClick handler.
typestringDefault:'button'Native button type.
disabledbooleanDefault:falseDisable the button.
classNamestringDefault:''Extra classes for the root element.
childrenReactNodeContent.
...restAny other props are passed to the underlying element.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'secondary' | 'flat' | 'success' | 'danger' | 'warning' | 'default' | Visual style. |
tooltip | string | – | Shows a styled Tooltip (use instead of the native title). |
tooltipPlacement | string | 'bottom' | Tooltip placement (see Tooltip). |
onClick | (event) => void | – | Click handler. |
type | string | 'button' | Native button type. |
disabled | boolean | false | Disable the button. |
className | string | '' | Extra classes for the root element. |
children | ReactNode | – | Content. |
...rest | – | Any other props are passed to the underlying element. |