Skip to content

Instantly share code, notes, and snippets.

@nnnkit
Last active September 9, 2021 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nnnkit/2b3dafbce71756f2d26331fb2d90f06b to your computer and use it in GitHub Desktop.
Save nnnkit/2b3dafbce71756f2d26331fb2d90f06b to your computer and use it in GitHub Desktop.
Button Component Usign Props

Button Component

Properties That The Button Component Can Be Passed

Property Description Type Required
disabled Sets the button to a disabled state boolean false
label The button text string true
onClickHandler The action to be dispatched onClick function true
size The size of the button ButtonSizes false
type The type of button ButtonTypes false

Types

Type Values Default
ButtonSizes SMALL MEDIUM LARGE MEDIUM
ButtonTypes PRIMARY SECONDARY TERTIARY PRIMARY

Example of using the Button component

<Button
  label="Button"
/>
<Button
  size="small"
  label="Button"
  type="secondary"
/>
<Button
  size="large"
  label="Button"
  type="tertiary"
  onClickHandler={() => alert("You Clicked Me!")}
/>

Demo

buttons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment