Git Product home page Git Product logo

chakra-color-picker's Introduction

chakra-color-picker

Color Picker Component Package for Chakra UI

Codesandbox Link Here

NPM Link Here

Install

npm i chakra-color-picker

Usage

Basic Usage

import { Flex, FormControl, ChakraProvider, theme } from "@chakra-ui/react";
import * as React from "react";
import { ColorPicker } from "chakra-color-picker";

export default function App() {
  const handleColorChange = (value) => {
    console.log(value);
  };

  return (
    <ChakraProvider theme={theme}>
      <Flex pt="48" justify="center" align="center" w="full">
        <ColorPicker onChange={handleColorChange} />
      </Flex>
    </ChakraProvider>
  );
}

API

Name
Type Required Default Description
onChange function true - Returns color value as a string to the function provided.
colors string[] false [ "gray.500", "red.500", "orange.500", "yellow.500", "green.500", "teal.500", "blue.500", "cyan.500", "purple.500", "pink.500", ] Accepts an array of color values that will override the default values.
bg string false "white" Changes the background color of the PopoverContent.
placement "top" | "right" | "bottom" | "left" | "auto" | "end" | "start" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | ... 6 more ... false "bottom" The placement of the popper relative to its reference.
isDisabled boolean false false If true, sets the color picker to be disabled.

Running project

  • Clone this repository
git clone https://github.com/Buupu/chakra-color-picker.git
  • Install all dependencies
npm i
  • Install package example dependencies
cd example
npm i
  • Start the package server, and the example server
# root directory
npm start

# example directory
npm run dev

chakra-color-picker's People

Contributors

buupu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.