0.1.2 • Published 2 years ago

react-custom-button-component v0.1.2

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

React Custom Button Component

A simple zero dependency react-button component for React 16+.

Installation

npm install react-custom-button-component --save

Alternatively you can also use

yarn add react-custom-button-component --dev

Basic Usage

import { Button } from 'react-custom-button-component';

const buttonStyles = {
  color: 'white',
  backgroundColor: 'blue',
  padding: '4px',
  borderRadius: '4px',
};

function demo() {
  return (
    <Button
      onClick={() => console.log('I am clicked!')}
      buttonText="Hello World"
      className={buttonStyles}
    />
  );
}

Props

react-custom-button-component accepts the following props. Instructions on how to use them are below.

nametypesdefaultDetail
buttonTextStringvalue variesEnter the text to display on button.
classNameStringvalue variesEnter the css class name for applying styles.
onClickevent handlervoidEvent handler for button.
stylecss stylesvalue variesDefault style prop of button element.
keyStringNumberKey Prop for button if needed.
disabledBooleanfalseTo disable a button element.
typeStringbuttonDefault type prop of button element.

License

Licensed under the MIT License.