About
HeroUI v3 ColorArea is a 2D color picker surface for adjusting two channels of a color at once (e.g. saturation/brightness) via a draggable thumb. Built on the real @heroui/react package with @heroui/styles, it supports controlled and uncontrolled value, disabled state, selectable color space & channels, a dotted-grid variant, and a custom render function. A thin re-export of the upstream component so consumers install and render the genuine HeroUI primitive.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds HeroUI Color Area to your project and fits it to your theme.
Code
How HeroUI Color Area is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client"
import type {Color} from "@heroui/react";
import { ColorSwatch, parseColor } from "@heroui/react"
import { ColorArea } from "@/components/ui/heroui-color-area"
import {useState} from "react";
export function ColorAreaControlled() {
const [color, setColor] = useState<Color>(parseColor("#9B80FF"));
return (
<div className="flex flex-col gap-4">
<ColorArea colorSpace="rgb" value={color} xChannel="red" yChannel="green" onChange={setColor}>
<ColorArea.Thumb />
</ColorArea>
<div className="flex w-[300px] items-center gap-3">
<ColorSwatch color={color} size="md" />
<p className="text-sm text-muted">
Current color:{" "}
<span className="font-medium">{color ? color.toString("hex") : "(empty)"}</span>
</p>
</div>
</div>
);
}
export default ColorAreaControlled








