f0rextasy

Color Token Table

Component

About

A small table that lists design-system color tokens with a live swatch, their CSS variable, and a one-click copy action.

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

Code

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

Usage.tsx

import {
  ColorTokenTable,
  type ColorToken,
} from "@/components/ui/color-token-table";

const tokens: ColorToken[] = [
  { name: "background", value: "oklch(1 0 0)", cssVar: "--background" },
  { name: "foreground", value: "oklch(0.145 0 0)", cssVar: "--foreground" },
  { name: "primary", value: "oklch(0.205 0 0)", cssVar: "--primary" },
  { name: "secondary", value: "oklch(0.97 0 0)", cssVar: "--secondary" },
  { name: "accent", value: "oklch(0.97 0 0)", cssVar: "--accent" },
  { name: "border", value: "oklch(0.922 0 0)", cssVar: "--border" },
];

export default function ColorTokenTableDemo() {
  return (
    <div className="flex min-h-[320px] w-full items-center justify-center bg-background p-6 text-foreground">
      <ColorTokenTable tokens={tokens} />
    </div>
  );
}

More by f0rextasy

View all
  • Newsletter Signup Card

    Newsletter Signup Card

    10
  • Stamp Seal

    Stamp Seal

    7
  • Network Graph

    Network Graph

    7
  • Board Checklist

    Board Checklist

    5
  • Empty State Card

    Empty State Card

    3
  • Running Order Timeline

    Running Order Timeline

    3
  • Invite Modal

    Invite Modal

    3
  • Time Input

    Time Input

    3