Button
Variant
Size
Disabled
Custom Tag
Props
variant
'default' | 'primary' | 'tertiary' | 'neutral'
Size of the button, defaults to default
.
size
'default' | 'small'
Button variant, defaults to default
.
tag
string
The HTML tag to use. Defaults to button
.
Action
Action Buttons can be passed an async function, which is executed on click.
While running, the button shows a loading state.
The button shows a success state when the promise is fulfilled and an error state when the promise is rejected.
Props
action
() => Promise<void>
The action to be run
variant
'default' | 'primary' | 'tertiary' | 'neutral'
Button variant, defaults to primary
.
timeout
number
The time after which the button’s state is reset to ready
. Defaults to
3000ms
pendingDelay
number
The delay after which the button state is set to pending
. This prevents
displaying the loading indicator for fast actions. Defaults to 100ms
disabled
boolean
Whether or not the button should be disabled
Close Button
Close Buttons can be used to close elements. They are used in components like Dialog or Drawer.