2019-06-06 07:12:28 +00:00
|
|
|
# GroupButton
|
|
|
|
|
2019-11-20 13:32:49 +00:00
|
|
|
Base Button is used for a group action on a page
|
|
|
|
|
|
|
|
### Usage
|
2019-06-06 07:12:28 +00:00
|
|
|
|
|
|
|
```js
|
2021-02-25 21:19:45 +00:00
|
|
|
import GroupButton from "@appserver/components/group-button";
|
2019-06-06 07:12:28 +00:00
|
|
|
```
|
|
|
|
|
2019-11-20 13:32:49 +00:00
|
|
|
```jsx
|
|
|
|
<GroupButton
|
|
|
|
label="Group button"
|
|
|
|
disabled={false}
|
|
|
|
isDropdown={false}
|
|
|
|
opened={false}
|
|
|
|
/>
|
|
|
|
```
|
2019-06-06 07:12:28 +00:00
|
|
|
|
2020-10-16 13:16:01 +00:00
|
|
|
It can be used as selector with checkbox for this following properties are combined: _isDropdown_, _isSeparator_.
|
2019-09-10 13:15:35 +00:00
|
|
|
|
2020-10-16 13:16:01 +00:00
|
|
|
_isSeparator_ will add vertical bar after button.
|
2019-09-10 13:15:35 +00:00
|
|
|
|
2020-10-16 13:16:01 +00:00
|
|
|
_isDropdown_ allows adding items to dropdown list in children.
|
2019-09-10 13:15:35 +00:00
|
|
|
|
|
|
|
For health of checkbox, button inherits part of properties of this component.
|
|
|
|
|
2019-11-20 13:32:49 +00:00
|
|
|
### Properties
|
2019-06-06 07:12:28 +00:00
|
|
|
|
2019-11-28 07:57:50 +00:00
|
|
|
| Props | Type | Required | Values | Default | Description |
|
|
|
|
| ------------------- | :------------: | :------: | :----: | :------------: | ----------------------------------------------------- |
|
|
|
|
| `action` | `func` | - | - | - | What the button will trigger when clicked |
|
|
|
|
| `checked` | `bool` | - | - | `false` | Initial value of checkbox |
|
|
|
|
| `className` | `string` | - | - | - | Accepts class |
|
|
|
|
| `disabled` | `bool` | - | - | `false` | Tells when the button should present a disabled state |
|
|
|
|
| `dropDownMaxHeight` | `number` | - | - | - | Selected height value of DropDown |
|
|
|
|
| `fontWeight` | `string` | - | - | `600` | Value of font weight |
|
|
|
|
| `id` | `string` | - | - | - | Accepts id |
|
|
|
|
| `isDropdown` | `bool` | - | - | `false` | Tells when the button should present a dropdown state |
|
|
|
|
| `isIndeterminate` | `bool` | - | - | `false` | Initial value of Indeterminate checkbox |
|
|
|
|
| `isSeparator` | `bool` | - | - | `false` | Tells when the button should contain separator |
|
|
|
|
| `label` | `string` | - | - | `Group button` | Value of the group button |
|
|
|
|
| `onChange` | `func` | - | - | - | Called when checkbox is checked |
|
|
|
|
| `onClick` | `func` | - | - | - | Property for onClick action |
|
|
|
|
| `onSelect` | `func` | - | - | - | Called when value is selected in selector |
|
|
|
|
| `opened` | `bool` | - | - | `false` | Tells when the button should be opened by default |
|
|
|
|
| `selected` | `string` | - | - | - | Selected value label |
|
|
|
|
| `style` | `obj`, `array` | - | - | - | Accepts css style |
|
|
|
|
| `tabIndex` | `number` | - | - | `-1` | Value of tab index |
|