terra vidhal

Theme Token Studio

Component 3

About

A dual light and dark theme token editor with live interface preview, colour pickers, hex validation, radius control, presets, WCAG contrast grading, copyable CSS variables and saved baseline comparison.

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

Code

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

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import {
  ThemeTokenStudio,
  type ThemePreset,
  type ThemeTokens,
} from "@/components/ui/theme-token-studio";

const DUSK_LIGHT: ThemeTokens = {
  background: "#f7f5fb",
  surface: "#ffffff",
  foreground: "#1d1930",
  primary: "#6d4aff",
  accent: "#e11d8f",
  muted: "#8b84a3",
  border: "#e6e1f2",
  radius: 12,
};

const DUSK_DARK: ThemeTokens = {
  background: "#0f0c19",
  surface: "#191429",
  foreground: "#f4f0ff",
  primary: "#a48bff",
  accent: "#ff6ab8",
  muted: "#9a94ad",
  border: "#2c2542",
  radius: 12,
};

const PRESETS: ThemePreset[] = [
  {
    id: "dusk",
    name: "Dusk",
    light: DUSK_LIGHT,
    dark: DUSK_DARK,
  },
  {
    id: "grove",
    name: "Grove",
    light: {
      background: "#f3f8f2",
      surface: "#ffffff",
      foreground: "#15251a",
      primary: "#16804a",
      accent: "#c48a05",
      muted: "#74857a",
      border: "#dbe7dc",
      radius: 10,
    },
    dark: {
      background: "#0b1510",
      surface: "#122018",
      foreground: "#eef8f0",
      primary: "#4ade80",
      accent: "#fbbf24",
      muted: "#92a397",
      border: "#22352a",
      radius: 10,
    },
  },
  {
    id: "signal",
    name: "Signal",
    light: {
      background: "#f7f7f5",
      surface: "#ffffff",
      foreground: "#17181a",
      primary: "#2450f5",
      accent: "#ff5c00",
      muted: "#7b7e85",
      border: "#e3e4e8",
      radius: 6,
    },
    dark: {
      background: "#0b0c0f",
      surface: "#15171b",
      foreground: "#f5f5f6",
      primary: "#7aa2ff",
      accent: "#ff8a3d",
      muted: "#8d9199",
      border: "#292c33",
      radius: 6,
    },
  },
];

export default function ThemeTokenStudioDemo() {
  return (
    <main className="flex min-h-screen w-full items-center justify-center bg-background px-4 py-12 sm:px-6">
      <ThemeTokenStudio
        initialLight={DUSK_LIGHT}
        initialDark={DUSK_DARK}
        presets={PRESETS}
        title="Design token studio"
        description="Pick a palette, edit any swatch against a live interface, check contrast and copy the CSS variables for both themes."
      />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Project Timeline

    Project Timeline

    30
  • Kanban Board

    Kanban Board

    20
  • Gravity Stars Background

    Gravity Stars Background

    20
  • Booking Calendar

    Booking Calendar

    18
  • Notification Center

    Notification Center

    16
  • Audio Waveform

    Audio Waveform

    16
  • Kpi Counter

    Kpi Counter

    16
  • Topographic Lines

    Topographic Lines

    16

Explore more

Part of PrequelUI Animate — browse the full library on 21st.dev.