Skip to main content

ThemeConfig

The ThemeConfig interface defines the structure for theme configuration objects in the tweakcn Theme Picker system.

Type Definition

Located in registry/nextjs/lib/themes-config.ts:5-11

Properties

string
required
Unique identifier for the theme (e.g., "default", "catppuccin", "vercel"). Used internally to reference themes and construct theme variant names.
string
required
Human-readable display name for the theme (e.g., "Default", "Catppuccin", "Vercel"). Shown in the theme picker UI.
string
required
Primary color for light mode in OKLCH color space format (e.g., "oklch(0.2050 0 0)"). This color is applied to UI elements when the light theme variant is active.
string
required
Primary color for dark mode in OKLCH color space format (e.g., "oklch(0.9220 0 0)"). This color is applied to UI elements when the dark theme variant is active.
string
required
CSS font stack for sans-serif text (e.g., "Inter, sans-serif", "system-ui, sans-serif"). Defines the primary font family for the theme.

Example Usage

Color Format

Themes use the OKLCH color space for better perceptual uniformity:
  • L (Lightness): 0-1 (0 = black, 1 = white)
  • C (Chroma): 0-0.4 (saturation intensity)
  • H (Hue): 0-360 (color wheel angle)

See Also

  • themes - Array of all available theme configurations
  • ThemeProvider - Provider component that enables theme switching
  • ThemeSwitcher - UI component for selecting themes