Skip to content

An easy to use canva style react color picker tool.

Notifications You must be signed in to change notification settings

lafetty/react-color-pick

Repository files navigation

🎨 React Color Pick

React Color Pick

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.

Table of Contents

Features

  • 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.

Installation

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

Usage

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.

Examples

To see the color picker in action, check out the following examples:

  1. Basic Color Picker: A simple implementation.
  2. Custom Styles: Customize the appearance of the picker.
  3. Dynamic Color Display: Show selected colors in real-time.

For more examples, refer to the documentation.

API

Props

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.

Events

  • onChange: This event fires when the user selects a new color. Use it to update your application's state.

Contributing

We welcome contributions! If you would like to help improve React Color Pick, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature/YourFeature).
  6. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or feedback, please reach out via GitHub Issues.

Releases

To download the latest version, visit our Releases page. Make sure to check the latest updates and features.

Color Picker

Thank you for checking out React Color Pick! We hope you find it useful for your projects.