1.1.0 • Published 3 years ago

@sakit-sa/react-button v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@sakit-sa/react-button

Simple, easy button for React

NPM JavaScript Style Guide

Button

Spinner gif

Live Playground

For examples of the react-button in action, go to https://abdilar.github.io/react-button.

OR

To run that demo on your own computer:

Getting Started

Install

npm install @sakit-sa/react-button

Usage

import React from 'react';

import Button, {SPINNER, COLOR, TARGET, ROUNDED, SIZE, TYPE, VARIANT} from '@sakit-sa/react-button';
import '@sakit-sa/react-button/dist/index.css';

const App = () => (
  <Button>Button</Button>
);

Props

NameTypeDefaultDescription
isLoadingbooleanfalseBoolean value to control whether the spinner is shown.
spinnerClassesobject{}Apply classes to the control spinner.
spinnerNamestringuikitSpecifies the name of the spinner (name includes: uikit, puff, grid, oval, rings, ball-triangle, tail-spin, three-dots).
spinnerRationumber-Specifies the size of the spinner.
activeTimerbooleanfalseBoolean value to control whether the countdown timer is shown.
timenumber0The value of the timer base on second.
timeClassesobject{}Apply classes to the control countdown timer.
timeFormatstringMM:SSFormats a time value.
classNameobject{}Apply classes to the control button.
sizestringsmallSpecifies the size of the button (size includes: small, medium, large, xlarge).
idstringreact-button-[randomNumber]The unique identifier for the component.
roundstringlowSpecifies the round border of the button. (round includes: empty, low, more, fully).
typestringbuttonSpecifies the type of the button. (type includes: button, submit, reset).
variantstringcontainedSpecifies the variant of the button. (variant includes: contained, outlined, text).
colorstringprimarySpecifies the color of the button. (color includes: primary, secondary, success, danger, warning, default).
hrefstring-Sets a hyperlink and uses anchor tag instead of a button.
hrefTargetstring_blankSpecifies the target of anchor tag. (hrefTarget includes: _blank, _self, _parent, _top).
isIconbooleanfalseBoolean value to control whether is the icon button.
disabledbooleanfalseBoolean value to control the button is disabled.
animatablebooleanfalseBoolean value to show an animation effect when clicking on the button.
children*node- (Required)Contents to be displayed within root element.
onClickfunction-Trigger when Clicking on the button.
onCompleteTimefunction-Trigger when countdown timer is zero.

className Token

button content

See examples for more information (go to https://abdilar.github.io/react-button/?path=/story/theme-prop--class-name)

spinnerClasses Token

wrapper spinner

See examples for more information (go to https://abdilar.github.io/react-spinner/?path=/story/theme-prop--class-name)

timeClasses Token

wrapperClass symbolClass digitClass hourClass minuteClass secondClass hourWrapperClass minuteWrapperClass secondWrapperClass

See examples for more information (go to https://abdilar.github.io/countdown-timer/?path=/story/theme--class-name)

License

MIT Licensed. © Copyright Saeed Abdilar