2019-06-20 14:25:45 +00:00
|
|
|
# MainButton
|
|
|
|
|
2019-11-21 13:24:59 +00:00
|
|
|
The main button is located at the top of the main menu. It may consist of 2 buttons, or on a click to show a pop-up window with other buttons
|
|
|
|
|
|
|
|
### Usage
|
2019-06-20 14:25:45 +00:00
|
|
|
|
|
|
|
```js
|
2022-07-22 19:01:25 +00:00
|
|
|
import MainButton from "@docspace/components/main-button";
|
2019-06-20 14:25:45 +00:00
|
|
|
```
|
|
|
|
|
2019-11-21 13:24:59 +00:00
|
|
|
```jsx
|
|
|
|
<MainButton text="Button" isDisabled={false} isDropdown={true}>
|
|
|
|
<div>Some button</div>
|
|
|
|
<Button label="Some button" />
|
2019-06-20 14:25:45 +00:00
|
|
|
</MainButton>
|
2019-11-21 13:24:59 +00:00
|
|
|
```
|
2019-06-20 14:25:45 +00:00
|
|
|
|
|
|
|
or
|
|
|
|
|
2019-11-21 13:24:59 +00:00
|
|
|
```jsx
|
|
|
|
<MainButton
|
|
|
|
text="Button"
|
|
|
|
isDropdown={false}
|
|
|
|
clickAction={() => SomeFunction()}
|
|
|
|
clickActionSecondary={() => SomeFunction()}
|
|
|
|
moduleName="people"
|
2019-06-20 14:25:45 +00:00
|
|
|
/>
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Properties
|
|
|
|
|
2019-12-03 11:47:48 +00:00
|
|
|
| Props | Type | Required | Values | Default | Description |
|
|
|
|
| ---------------------- | :------------: | :------: | :---------------------------: | :----------: | ------------------------------------------------------------------------ |
|
|
|
|
| `className` | `string` | - | - | - | Accepts class |
|
|
|
|
| `clickActionSecondary` | `func` | - | - | - | What the secondary button will trigger when clicked |
|
|
|
|
| `clickAction` | `func` | - | - | - | What the main button will trigger when clicked |
|
|
|
|
| `iconName` | `string` | - | - | `PeopleIcon` | Icon inside button |
|
|
|
|
| `id` | `string` | - | - | - | Accepts id |
|
|
|
|
| `isDisabled` | `bool` | - | - | `false` | Tells when the button should present a disabled state |
|
|
|
|
| `isDropdown` | `bool` | - | - | `true` | Select a state between two separate buttons or one with a drop-down list |
|
|
|
|
| `moduleName` | `oneOf` | - | `people`, `mail`, `documents` | - | The name of the module where the button is used |
|
|
|
|
| `onClick` | `func` | - | - | - | DropDown component click action |
|
|
|
|
| `opened` | `bool` | - | - | - | Open DropDown |
|
|
|
|
| `style` | `obj`, `array` | - | - | - | Accepts css style |
|
|
|
|
| `text` | `string` | - | - | `Button` | Button text |
|