kevingirelli

Color Swatches

Forms

About

A radio-group style color picker that lets a user choose one color from a row of swatches, with keyboard navigation and native form support.

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

Code

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

Usage.tsx

import { ColorSwatches } from "@/components/ui/color-swatches";

export default function ColorSwatchesDemo() {
  return (
    <ColorSwatches
      aria-label="Sail colour"
      defaultValue="brass"
      colors={[
        { value: "brass", color: "#d9b06a", label: "Brass" },
        { value: "sea", color: "#6fb3c2", label: "Sea" },
        { value: "coral", color: "#e07a5f", label: "Coral" },
        { value: "slate", color: "#6b7280", label: "Slate", disabled: true },
      ]}
    />
  );
}

Dependencies

More by kevingirelli

View all
  • Aurora

    Aurora

    82
  • QR Code

    QR Code

    74
  • Warp Gradient

    Warp Gradient

    55
  • FAQ Section

    FAQ Section

    53
  • Corner Frame

    Corner Frame

    43
  • Wave Text

    Wave Text

    43
  • Animated Border

    Animated Border

    43
  • Spotlight

    Spotlight

    33

More in Forms

View all
  • Premium Auth

    Premium Auth

    525
  • Contact Card

    Contact Card

    1K
  • Login 2

    Login 2

    8
  • Card Studio

    Card Studio

    41
  • Book A Demo 1

    Book A Demo 1

    74
  • HeroUI Field Error

    HeroUI Field Error

    10
  • Form

    Form

    16
  • Book A Demo 3

    Book A Demo 3

    90