@farooq0373/reactbutton
v0.0.1
Published
A simple and customizable React button component using `styled-components`.
Maintainers
Readme
reactbutton
A simple and customizable React button component using styled-components.
Installation
You can install the package using npm or yarn:
npm install @farooq0373/reactbuttonor
yarn add @farooq0373/reactbuttonUsage
Import and use the Button component in your React project:
import React from "react";
import Button from "@farooq0373/reactbutton";
const App = () => {
return (
<div>
<Button variant="primary">Primary Button</Button>
<Button variant="secondary">Secondary Button</Button>
</div>
);
};
export default App;Props
| Prop Name | Type | Default | Description |
|-----------|---------------------|---------|-------------------------------------------------|
| variant | "primary" | "secondary" | "primary" | Defines the button style (primary or secondary) |
| children | React.ReactNode | - | The content inside the button |
| ...props | ButtonHTMLAttributes | - | All default button attributes |
Styling
The button uses styled-components, and the styles can be customized as needed.
- Primary Button: Blue (
#007bff) - Secondary Button: Gray (
#6c757d)
License
This project is licensed under the MIT License.
Happy Coding! 🚀
