1.0.15 • Published 1 year ago

react-easy-button v1.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-easy-button

Implement easily customize out of the box. Work with a vast number of pre-maid react button themes

1668563583029

Installation

# NPM
npm i react-easy-button

# Yarn
yarn add react-easy-button

# Pnpm 
pnpm add react-easy-button

Simple example

import React from 'react'
import {EasyButton} from 'react-easy-button';

const Button: React.FC = () => {
    return (
	<EasyButton label="Press me" />
    )
}

Custom style

Style

Note: If theme is not equal to custom it will not work

If the style is provided through style prop it will reset previous styles & apply provided style. In this example below button will only have color & background color style. The rest of the styles will be reset. To avoid this use extendStyle prop.

<EasyButton label="Press me" style={{color: "#242424", backgroundColor: "#fcfcfc"}} />

Extend styles

It will keep all previous styles & only change provided styles. It will work for all themes

<EasyButton label="Press me" extendStyle={{color: "#242424", backgroundColor: "#fcfcfc"}} />

EasyButton props

AttributesTypeDefault valueDescription
labelstringundefinedRequired. If not provided, will throw error.
titlestringundefinedOptional. Title attribute of html button tag.
themestringprimaryOptional. Available themes (custom, error, success, warn, purple, pink, primary)
debounceTimeoutnumber0Optional. Delaytime in ms (eg. 100 = 100ms))
disabledbooleanfalseOptional
styleobjectundefinedOptional. If provided & theme === "custom" then only provided style will be applyed
extendStyleobjectundefinedOptional. If provided, will change only provided styles. eg. theme="purple" & extendStyle={{border: "2px solid purple"}} it will keep theme styles with provided style border: "2px solid purple"""
hoverStyleobjectundefinedOptional. If mouse entered then provided style will applied
extendHoverStyleobjectundefinedOptional. Provided styles will be applied if mouse entered.
easyRefobjectundefinedOptional. Will return referance of the button
onClickfunctionundefinedOptional. Will run the function if button is clicked
onHoverfunctionundefinedOptional. Will run the function if mouse cursor hovered on the button
onFocusfunctionundefinedOptional. Will run the function if button is focused

License

MIT

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago