2019-08-01 07:50:25 +00:00
|
|
|
# ToggleButton
|
|
|
|
|
|
|
|
Custom toggle button input
|
|
|
|
|
2019-11-21 13:33:47 +00:00
|
|
|
### Usage
|
2019-08-01 07:50:25 +00:00
|
|
|
|
|
|
|
```js
|
2019-11-21 13:33:47 +00:00
|
|
|
import { ToggleButton } from "asc-web-components";
|
|
|
|
```
|
2019-08-01 07:50:25 +00:00
|
|
|
|
2019-11-21 13:33:47 +00:00
|
|
|
```jsx
|
|
|
|
<ToggleButton
|
|
|
|
label="text"
|
|
|
|
onChange={event => console.log(event.target.value)}
|
|
|
|
isChecked={false}
|
|
|
|
/>
|
2019-08-01 07:50:25 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Properties
|
|
|
|
|
2019-11-21 13:33:47 +00:00
|
|
|
| Props | Type | Required | Values | Default | Description |
|
|
|
|
| ------------ | :------: | :------: | :----: | :-----: | -------------------------------------------------------------- |
|
|
|
|
| `label` | `string` | - | - | - | Label of the input |
|
|
|
|
| `isChecked` | `bool` | - | - | - | The checked property sets the checked state of a ToggleButton. |
|
|
|
|
| `isDisabled` | `bool` | - | - | - | Disables the ToggleButton |
|
|
|
|
| `onChange` | `func` | ✅ | - | - | Will be triggered whenever an ToggleButton is clicked |
|