react-custom-button-component
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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.

name types default Detail
buttonText String value varies Enter the text to display on button.
className String value varies Enter the css class name for applying styles.
onClick event handler void Event handler for button.
style css styles value varies Default style prop of button element.
key String Number Key Prop for button if needed.
disabled Boolean false To disable a button element.
type String button Default type prop of button element.

License

Licensed under the MIT License.

Package Sidebar

Install

npm i react-custom-button-component

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

10.9 kB

Total Files

14

Last publish

Collaborators

  • _harshad