Skip to content
Components

Colors & theming

Connect your interface to shared color tokens. Put ThemeProvider near the root so primitives and ready-made components resolve the same palette.

Theme tokens and palette tokens

theme-primary is a semantic role. You decide which palette entry it points to. color-blue-900 is a specific palette entry. Both are resolved through the provider.

INTERACTIVE EXAMPLE

Loading preview…

Use semantic tokens for roles that should change together. Use palette tokens when a deliberate fixed color is appropriate.

Light and dark mode

Control the provider's mode prop with React state. It selects the light or dark palette; it does not automatically redesign every custom color or browser document style in your application.

INTERACTIVE EXAMPLE

Loading preview…

Check text contrast, surfaces, borders, disabled states, and focus rings in each mode. Raw hex colors keep their literal value rather than following the palette.

Per-component colors

Button supports backgroundColor for its surface and textColor for explicit content color. Other components have their own color props and internal views parts. Check the current TypeScript props before copying an override across components.

Custom palettes and external tools

The provider also accepts light and dark palette configurations. useTheme exposes helpers such as getColor for CSS variables and getColorHex when another library needs a literal color.

See the full theming reference for palette structure and resolution rules. Start with a few semantic tokens before replacing the entire palette.

Browse documentation source