2019-05-20 10:30:11 +00:00
|
|
|
# Buttons: Button
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```js
|
|
|
|
import { Button } from 'asc-web-components';
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Description
|
|
|
|
|
2019-06-28 08:36:06 +00:00
|
|
|
Button is used for a action on a page.
|
2019-05-20 10:30:11 +00:00
|
|
|
|
|
|
|
#### Usage
|
|
|
|
|
|
|
|
```js
|
2019-06-06 09:16:14 +00:00
|
|
|
<Button size='base' isDisabled={false} onClick={() => alert('Button clicked')} label="OK" />
|
2019-05-20 10:30:11 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Properties
|
|
|
|
|
|
|
|
| Props | Type | Required | Values | Default | Description |
|
|
|
|
| ------------------ | -------- | :------: | --------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
2019-06-28 08:36:06 +00:00
|
|
|
| `label` | `string` | - | - | - | Button text |
|
2019-05-20 10:30:11 +00:00
|
|
|
| `primary` | `bool` | - | - | - | Tells when the button should be primary |
|
2019-06-28 08:36:06 +00:00
|
|
|
| `size` | `oneOf` | - | `base`, `middle`, `big`, `huge` | `base` | Size of button |
|
2019-05-23 07:13:03 +00:00
|
|
|
| `isDisabled` | `bool` | - | - | - | Tells when the button should present a disabled state |
|
2019-06-28 08:36:06 +00:00
|
|
|
| `isLoading` | `bool` | - | - | - | Tells when the button should show loader icon |
|
2019-05-20 10:30:11 +00:00
|
|
|
| `onClick` | `func` | ✅ | - | - | What the button will trigger when clicked |
|
2019-06-28 08:36:06 +00:00
|
|
|
|