DocSpace-client/packages/shared/components/main-button
2023-12-15 12:45:04 +03:00
..
index.tsx Shared:Components:MainButton: rewrite to typescript 2023-12-15 12:45:04 +03:00
MainButton.stories.tsx Shared:Components:MainButton: rewrite to typescript 2023-12-15 12:45:04 +03:00
MainButton.styled.ts Shared:Components:MainButton: rewrite to typescript 2023-12-15 12:45:04 +03:00
MainButton.test.tsx Shared:Components:MainButton: rewrite to typescript 2023-12-15 12:45:04 +03:00
MainButton.theme.tsx Shared:Components:MainButton: rewrite to typescript 2023-12-15 12:45:04 +03:00
MainButton.tsx Shared:Components:MainButton: rewrite to typescript 2023-12-15 12:45:04 +03:00
MainButton.types.tsx Shared:Components:MainButton: rewrite to typescript 2023-12-15 12:45:04 +03:00
README.md Shared:Components:MainButton: rewrite to typescript 2023-12-15 12:45:04 +03:00

MainButton

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

import { MainButton } from "@docspace/shared/components";
<MainButton text="Button" isDisabled={false} isDropdown={true}>
  <div>Some button</div>
  <Button label="Some button" />
</MainButton>

or

<MainButton
  text="Button"
  isDropdown={false}
  onkAction={() => SomeFunction()}
  moduleName="people"
/>

Properties

Props Type Required Values Default Description
className string - - - Accepts class
onAction 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