DocSpace-client/packages/shared/components/button
2023-12-20 12:14:18 +03:00
..
Button.enums.ts Shared:Components:Button: rewrite to typescript 2023-11-30 13:26:53 +03:00
button.stories.tsx Shared:Components:Checkbox: rewrite to typescript 2023-12-05 20:43:04 +03:00
Button.styled.tsx Shared:Components:Table\ColorTheme: rewrite to typescript 2023-12-20 12:14:18 +03:00
button.test.tsx Shared:Components:Button: rewrite to typescript 2023-11-30 13:26:53 +03:00
Button.theme.tsx Shared:Components:Button: rewrite to typescript 2023-11-30 13:26:53 +03:00
Button.tsx Shared: refactoring and apply code guide style 2023-12-05 19:52:30 +03:00
Button.types.ts Shared:Components:Table\ColorTheme: rewrite to typescript 2023-12-20 12:14:18 +03:00
index.tsx Shared: refactoring and apply code guide style 2023-12-05 19:52:30 +03:00
README.md Shared:Components:Button: rewrite to typescript 2023-11-30 13:26:53 +03:00

Button

Button is used for a action on a page.

Usage

import { Button } from "@docspace/shared/components";
<Button
  size={ButtonSize.extraSmall}
  isDisabled={false}
  onClick={() => alert("Button clicked")}
  label="OK"
/>

Properties

Props Type Required Values Default Description
className string - - - Accepts class
icon node - - null Icon node element
id string - - - Accepts id
isClicked bool - - false Tells when the button should present a clicked state
isDisabled bool - - false Tells when the button should present a disabled state
isHovered bool - - false Tells when the button should present a hovered state
isLoading bool - - false Tells when the button should show loader icon
label string - - - Button text
onClick func - - - What the button will trigger when clicked
primary bool - - false Tells when the button should be primary
scale bool - - false Scale width of button to 100%
size oneOf - extraSmall, small, normal, medium extraSmall Size of button. The normal size equals 36px and 40px in height on the Desktop and Touchcreen devices
style obj, array - - - Accepts css style
tabIndex number - - -1 Button tab index
minWidth string - - null Sets the min width of the button