1.1.1 • Published 5 years ago

@bnnvara/buttons v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

BNNVARA Buttons

Buttons allow users to take actions, and make choices, with a single tap. There are two type of buttons that can be used, one basic button in various colors and a button with an icon in various colors. For examples please visit the demo.

Demo Patterns library

Installation

npm install @bnnvara/buttons

Basic usage

Import

import the basic button : import { BaseButton } from '../packages/buttons/src';

import the icon button : import { IconButton } from '../packages/buttons/src';

React The basic version of the button is called like this:

<BaseButton
  variant="red"
  value="value"
  type="button"
  onClick={clickHandler}
>Button</BaseButton

See the proptypes below for all possible proptypes.

Variants

Base Button

This is the most used variant of the button. This button can be used in two sizes: large and small. For the default version is no extra code necessary, for the small one you can write code like this:

<BaseButton
  variant="red"
  type="button"
  size="small"
  handleClick={clickHandler}
></BaseButton>

Disabled

To make a button disabled use the following code:

<BaseButton
  variant="red"
  type="button"
  disabled
  onClick={clickHandler}
>Button</Button

Props

NameTypeDescriptionRequired
VariantStringProp to set the color of the button. Possible options are: 'red', 'white', 'black', 'outline'.Required
SizeStringSet the size of the button. Possible options are: 'large', 'small'.Not required
childrenStringSet the text in the button.Required
TypeStringSet the type of the button. Possible options are: 'link', button', 'reset', 'submit'Required
disabledBooleanSet the button to disabled. Possible options are: 'true', ''.Not required
onClickFunctionSet a function to the button.Required
1.1.1

5 years ago

1.1.0

5 years ago

0.0.16

5 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago