Built-in Themes
Rezi ships with six production-ready themes:- Dark (Default)
- Light
- Dimmed
- High Contrast
- Nord
- Dracula
Setting the Theme
Set the active theme usingapp.setTheme():
Theme Structure
Themes use semantic color tokens:Extending Themes
Extend existing themes with overrides:Scoped Theme Overrides
Apply theme overrides to specific subtrees:Using Theme Colors
Reference theme colors in style props:"fg.primary","fg.secondary","fg.muted","fg.inverse""bg.base","bg.elevated","bg.overlay","bg.subtle""accent.primary","accent.secondary","accent.tertiary""success","warning","error","info""border.subtle","border.default","border.strong"
Theme Transitions
Animate theme changes smoothly:app.setTheme(), colors interpolate smoothly instead of changing instantly.
Spacing Tokens
Themes also define spacing scales:Focus Indicators
Customize focus ring appearance:Design System Integration
Themes power the design system recipes. When widgets useintent or design system props, they automatically use theme colors:
Accessibility
Ensure sufficient contrast ratios:highContrastTheme meets WCAG AAA standards.
Theme Presets Registry
Access all built-in themes:Custom Color Palettes
Create a theme from scratch:Best Practices
Semantic Tokens
Use semantic color tokens (
"fg.primary", "accent.primary") instead of hardcoded RGB values. This makes your UI automatically adapt to theme changes.Extend, Don't Fork
Start with a built-in theme and extend it with
extendTheme() instead of creating themes from scratch.Test Accessibility
Use
contrastRatio() to verify your custom colors meet WCAG standards. Aim for at least 4.5:1 for normal text.Scoped Overrides
Use scoped theme overrides on containers when you need localized color changes without creating a full theme.
Next Steps
Styling
Learn about text styles and design system integration
Input & Focus
Handle keyboard input and focus management