Welcome to the Button Component Library! This is a simple React component library designed for testing and learning purposes.
This library offers a reusable Button component that supports customizable styles. You can pass in various props, including color, backgroundColor, and all the default button props available in
React.
You can install the package using npm:
bash npm install @aswadali/compolib
Or with yarn:
bash yarn add @aswadali/compolib
Here's a quick example of how to use the Button component in your React application:
import React from 'react';
import Button from '@aswadali/compolib';
const App = () => {
return (
<div>
<Button color="white" backgroundColor="blue" onClick={() => alert('Button clicked!')}>
Click Me
</Button>
</div>
);
};
export default App;The Button component supports the following props:
- color: Sets the text color of the button.
- backgroundColor: Sets the background color of the button.
- ...props: Accepts all default button props from React, such as
onClick,disabled,type, etc.
<Button color="white" backgroundColor="green" onClick={() => console.log('Green Button clicked!')}>
Green Button
</Button>Feel free to contribute to this library! Whether it's reporting a bug, suggesting improvements, or submitting a pull request, your contributions are welcome.
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes.
- Push to your branch.
- Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for more information.
This library was created for learning and testing purposes. Thanks to the open-source community for their support and contributions.
Happy coding! 🎉
If you have any questions or need further assistance, please feel free to reach out.