your-button-library
v1.0.1
Published
Demo for npm library
Maintainers
Readme
Your Button Library
A customizable button component for React applications.
Installation
To install the library, run the following command:
npm install your-button-libraryUsage
Import the Button component and use it in your React application:
import React from "react";
import { Button } from "your-button-library";
const App = () => {
return (
<div>
<Button>Click me!</Button>
</div>
);
};Props
The Button component accepts the following props:
type: The type of button (primary or secondary). Defaults toprimary.textColor: The color of the button text.size: The size of the button (small, medium, or large). Defaults tomedium.onClick: The function to call when the button is clicked.children: The content of the button.
Examples
Primary Button
<Button type="primary">Primary Button</Button>Secondary Button
<Button type="secondary">Secondary Button</Button>Small Button
<Button size="small">Small Button</Button>Large Button
<Button size="large">Large Button</Button>Button with Custom Text Color
<Button textColor="#fff">Button with Custom Text Color</Button>Button with Custom onClick Handler
<Button onClick={() => console.log("Button clicked!")}>
Button with Custom onClick Handler
</Button>Contributing
Contributions are welcome! Please submit a pull request with your changes.
License
Your Button Library is licensed under the MIT License.
