react-buttons-library
v1.2.4
Published
A library for reuseable react buttons.
Downloads
95
Maintainers
Readme
React Buttons Library
react-buttons-library is a simple and reusable React buttons library that provides various button styles out of the box. It helps you quickly implement button components in your React projects with minimal setup and customizability.
Installation
You can install the library using npm or yarn:
npm
npm install react-buttons-library
yarn
yarn add react-buttons-library
Usage
After installation you can use any of the components of react-buttons-library just by importing it. The key feature is you don't need to import the button everytime you use the different one. Just import the button only once and use different varients of buttons.
Parameters
The Button component takes 3 parameters:
- label
- btnClass
- onClick
label
The label parameter is used to give the text of the button. Like Click Me or Download and wahtever you want.
btnClass
This parameter is used to define the style of the button as defined in the library. You don't have to put in it something just go to the library choose the button you want and in that button you will get this parameter and that is the styling of the button as shown in the example.
onClick
This parameter is used to define the function you want to perform when the button is clicked as normal buttons do.
Example
import React from 'react';
import { Button } from 'react-buttons-library';
const App = () => {
return (
<div>
<Button label='Click Me' btnClass='lgOut' onClick={() => alert('Button is Clicked')} />
</div>
);
};
export default App;
Author
Khayam Ijaz
License
This project is licensed under the MIT License.