A toggle button allows to toggle a selection on or off, for example switching between two states or modes.
import { ToggleButton } from '@frontile/buttons';
You can pass the attribute disabled
to disable a toggle button.
Element: HTMLButtonElement
Name | Type | Default | Description |
---|---|---|---|
class
|
string
|
- | Custom class name, it will override the default ones using Tailwind Merge library. |
intent
|
enum
|
- | The intent of the button |
isInGroup
|
boolean
|
- | If button is part of a group. Most of the time, this is automatically set when using the ButtonGroup component. |
isSelected
|
boolean
|
false
|
If the button is currently selected |
onChange
|
function
|
- | Callback when the buttle is toggled |
size
|
enum
|
- | The size of the button |
Name | Type | Default | Description |
---|---|---|---|
default
*
|
Array
|
- |