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

    54
  • Warp Gradient

    Warp Gradient

    48
  • QR Code

    QR Code

    48
  • FAQ Section

    FAQ Section

    46
  • Wave Text

    Wave Text

    37
  • Corner Frame

    Corner Frame

    36
  • Animated Border

    Animated Border

    32
  • Spotlight

    Spotlight

    23

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 2

    Login 2

    7
  • Authentication Card

    Authentication Card

    46
  • Login 1

    Login 1

    52
  • Contact Card

    Contact Card

    1K
  • Login Form

    Login Form

    6
  • Form

    Form

    16
  • Book A Demo 3

    Book A Demo 3

    83