appica-dev

Color Area

Component 6

About

A draggable 2D color plane for picking two channels at once (like saturation and brightness), with keyboard, RTL and form support.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Color Area to your project and fits it to your theme.

Code

How Color Area is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { ColorArea } from "@/components/ui/color-area";

const PLANES = [
  { space: "rgb", xChannel: "red", yChannel: "green", label: "RGB" },
  { space: "hsl", xChannel: "saturation", yChannel: "lightness", label: "HSL" },
  {
    space: "hsb",
    xChannel: "saturation",
    yChannel: "brightness",
    label: "HSB",
  },
] as const;

export default function ColorAreaSpaces() {
  return (
    <div className="grid grid-cols-3 gap-6">
      {PLANES.map(({ space, xChannel, yChannel, label }) => (
        <div key={space} className="flex flex-col items-center gap-2">
          <ColorArea
            defaultValue="#3b82f6"
            colorSpace={space}
            xChannel={xChannel}
            yChannel={yChannel}
            aria-label={`${label} color area`}
            className="size-32"
          />
          <span className="text-foreground-muted text-xs font-medium">
            {label}
          </span>
        </div>
      ))}
    </div>
  );
}

More by appica-dev

View all
  • Border Beam

    Border Beam

    43
  • Text Animate

    Text Animate

    19
  • Carousel

    Carousel

    14
  • Sparkline

    Sparkline

    7
  • Table of Contents

    Table of Contents

    6
  • Avatar

    Avatar

    6
  • Background Pattern

    Background Pattern

    3
  • Autocomplete

    Autocomplete

    2