Color Picker

Allows users to select a color. Modeled after the color picker in Figma.

Installation

npx love-ui@latest add color-picker

Usage

import { ColorPicker, ColorPickerSelection, ColorPickerHue, ColorPickerAlpha, ColorPickerEyeDropper, ColorPickerOutput, ColorPickerFormat } from "@/components/color-picker"
<ColorPicker defaultValue="#3b82f6" onValueChange={(color) => console.log(color)}>
  <ColorPickerSelection />
  <ColorPickerHue />
  <ColorPickerAlpha />
  <ColorPickerEyeDropper />
  <ColorPickerFormat>
    <ColorPickerOutput />
  </ColorPickerFormat>
</ColorPicker>

Features

  • Interactive color selection with drag and drop functionality
  • Hue and alpha sliders for precise color adjustments
  • EyeDropper tool for picking colors from anywhere on screen
  • Multiple color format outputs (HEX, RGB, CSS, HSL)
  • Real-time color preview
  • Fully customizable through className and props

Examples

Default