Dakik// Bits
Dakik.co.uk
All bits

// Forms

Color Picker

Pick colors with hue and alpha controls.

// Rendering preview…

// Install

npx shadcn@latest add @dakik/color-picker

// Usage

1import { ColorPicker, ColorPickerControl, ColorPickerTrigger, ColorPickerTransparencyGrid } from "@/components/ui/color-picker";
2
3<ColorPicker />

// Code

1"use client";
2
3import {
4 ColorPicker as ArkColorPicker,
5 type ColorPickerValueChangeDetails,
6 parseColor as parseColorArk,
7 useColorPickerContext,
8} from "@ark-ui/react/color-picker";
9import { ark } from "@ark-ui/react/factory";
10import { Portal } from "@ark-ui/react/portal";
11import { CheckIcon, Pipette } from "lucide-react";
12import React from "react";
13import { cn } from "@/lib/utils";
14import { Button, type ButtonProps } from "@/registry/react/components/button";
15
16export const parseColor = parseColorArk;
17export const useColorPicker = useColorPickerContext;
18
19export interface ColorPickerProps
20 extends Omit<
21 React.ComponentProps<typeof ArkColorPicker.Root>,
22 "defaultValue" | "value"
23 > {
24 /**
25 * The default value of the color picker.
26 */
27 defaultValue?: string;
28 /**

// Dependencies