Welcome to React Color Pick! This is an easy-to-use, Canva-style color picker tool built for React applications. With this component, you can enhance your projects by allowing users to select colors seamlessly.
- Intuitive Interface: A user-friendly design that mimics popular graphic design tools.
- Customizable: Adjust colors, shapes, and sizes to fit your needs.
- Fast Performance: Optimized for quick color selection.
- Responsive: Works well on various screen sizes.
- Easy Integration: Simple to add to any React project.
To get started with React Color Pick, install it via npm:
npm install react-color-pick
Or if you prefer Yarn:
yarn add react-color-pick
To use the color picker in your React component, import it as follows:
import React from 'react';
import ColorPicker from 'react-color-pick';
const MyComponent = () => {
const [color, setColor] = React.useState('#ff0000');
return (
<div>
<h1>Select a Color</h1>
<ColorPicker
color={color}
onChange={setColor}
/>
<div style={{ backgroundColor: color, height: '100px', width: '100px' }} />
</div>
);
};
export default MyComponent;
This example shows a basic implementation. You can customize it further based on your requirements.
To see the color picker in action, check out the following examples:
- Basic Color Picker: A simple implementation.
- Custom Styles: Customize the appearance of the picker.
- Dynamic Color Display: Show selected colors in real-time.
For more examples, refer to the documentation.
Prop | Type | Description |
---|---|---|
color |
string | The current color selected. |
onChange |
function | Callback function triggered on color change. |
width |
number | Width of the color picker. |
height |
number | Height of the color picker. |
- onChange: This event fires when the user selects a new color. Use it to update your application's state.
We welcome contributions! If you would like to help improve React Color Pick, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or feedback, please reach out via GitHub Issues.
To download the latest version, visit our Releases page. Make sure to check the latest updates and features.
Thank you for checking out React Color Pick! We hope you find it useful for your projects.