buttongroup-library
v1.0.18
Published
Button Groups
Downloads
5
Readme
Button Group Library
Description
The Button Group Library is a React component that allows users to create a group of buttons with customizable styles, including rounded corners and an active state.
Installation
To install the Button Group Library, use npm or yarn:
npm install buttongroup-library
or
yarn add buttongroup-library
Usage
To use the TextButton component, import it into your React application:
- import {TextButton} from 'buttongroup-library';
- Create an array of buttons with the required properties: const buttons = [ { id: 1, label: 'Button 1' }, { id: 2, label: 'Button 2' }, ];
- Render the TextButton component in your JSX, passing the necessary props:
Props TextButton Component buttons (Array): An array of objects representing each button with properties id and label. isRounded (Boolean): Specifies whether the buttons should have rounded corners. active (Number): The ID of the currently active button. onButtonClick (Function): A function to handle button clicks.
Customization The TextButton component supports customization using CSS and the following props:
buttons: Array of button objects isRounded: Boolean to set rounded or square corners for buttons active: ID of the currently active button
@babel/cli, @babel/core, @babel/preset-env, @babel/preset-react, babel-loader: Babel dependencies for transpiling. css-loader, style-loader: Loaders for handling CSS files. react: React library. webpack, webpack-cli: Bundling and build tools