Back to Documentation

Theme System

Customize the look and feel of your app with our flexible theming system.

How theming works

Every app has a theme that controls its colors, fonts, and overall look. You can change your app's theme at any time from the theme editor — no design experience needed.

Pick a preset

The easiest way to change your app's look. Choose from a collection of handcrafted themes and apply one with a single click.

Customize individual values

For more control, you can fine-tune any color, font, or spacing value directly. Start from a preset and tweak from there.

Advanced customization

If you want to go beyond the presets, the theme editor lets you adjust individual values like your primary color, background, fonts, and corner roundness. Changes preview instantly so you can see exactly what your app will look like.

Tip

Start from a preset that's close to what you want, then adjust the individual values. This is much easier than building a theme from scratch.

Available Theme Variables

Here are all the CSS custom properties available in our theme system. Each variable serves a specific purpose in creating a cohesive design.

Core Colors

VariablePurposeUsage
--backgroundMain page background colorBody, main containers
--foregroundPrimary text colorHeadings, body text
--cardCard background colorCards, panels, modals
--card-foregroundText color on cardsText within cards
--popoverPopover background colorPopovers, tooltips, dropdowns
--popover-foregroundText color on popoversText within popovers

Semantic Colors

VariablePurposeUsage
--primaryPrimary brand colorPrimary buttons, links, highlights
--primary-foregroundText color on primary elementsText on primary buttons
--secondarySecondary accent colorSecondary buttons, subtle highlights
--secondary-foregroundText color on secondary elementsText on secondary buttons
--mutedMuted background colorDisabled states, subtle backgrounds
--muted-foregroundMuted text colorSecondary text, descriptions
--accentAccent color for highlightsHover states, active elements
--accent-foregroundText color on accent elementsText on accent backgrounds
--destructiveDestructive action colorDelete buttons, error states, warnings
--destructive-foregroundText color on destructive elementsText on destructive buttons

Border & Input

VariablePurposeUsage
--borderBorder colorDividers, card borders
--inputInput field border colorForm inputs, text areas
--ringFocus ring colorFocus indicators, accessibility
--radiusBorder radius valueRounded corners (e.g., "0.5rem")
--spacingBase spacing unitConsistent spacing (e.g., "0.25rem")

Chart Colors

VariablePurposeUsage
--chart-1First chart colorData visualization, graphs
--chart-2Second chart colorData visualization, graphs
--chart-3Third chart colorData visualization, graphs
--chart-4Fourth chart colorData visualization, graphs
--chart-5Fifth chart colorData visualization, graphs

Sidebar Colors

Sidebar-specific colors for apps with navigation sidebars.

VariablePurposeUsage
--sidebar-backgroundSidebar background colorSidebar containers
--sidebar-foregroundSidebar text colorSidebar text, icons
--sidebar-primarySidebar primary colorActive sidebar items
--sidebar-primary-foregroundText color on sidebar primaryText on active sidebar items
--sidebar-accentSidebar accent colorHover states in sidebar
--sidebar-accent-foregroundText color on sidebar accentText on hover states
--sidebar-borderSidebar border colorSidebar dividers, edges
--sidebar-ringSidebar focus ring colorFocus indicators in sidebar

Typography

VariablePurposeUsage
--font-sansSans-serif font familyBody text, UI elements
--font-serifSerif font familyHeadings, decorative text
--font-monoMonospace font familyCode blocks, technical text

Theme Conventions

Our theme system follows consistent naming conventions that make it intuitive to work with. Understanding these patterns will help you create harmonious themes.

Background/Foreground Pairs

Each UI element typically has a background color and a matching foreground (text) color that ensures proper contrast. For example, primary and primary-foreground are used together.

Primary Background
with Primary Foreground text
Secondary Background
with Secondary Foreground text
Muted Background
with Muted Foreground text
Accent Background
with Accent Foreground text

Semantic Color Variables

Our theme system uses semantic color variables that describe their purpose rather than their appearance. This approach ensures consistent design and makes theme switching seamless.

VariablePurpose
background / foregroundMain page background and text colors
card / card-foregroundCard elements and their text
primary / primary-foregroundPrimary actions, buttons, highlights
muted / muted-foregroundSubdued elements, secondary text