Theme
Control your app's visual appearance with seven configuration options. Kookie UI Theme is a fork of Radix Themes, offering the same foundation with custom enhancements for theming and accessibility.
This is an enhanced version of the Theme component from Radix Themes. For the original API reference, see the Radix Themes Theme documentation.
Installation
shellUsage
Wrap your application with the Theme component at the root level:
tsxNext.js App Router
When using Next.js App Router, Theme must be wrapped in a Client Component since it uses React Context. Create a providers.tsx file:
tsxThen use it in your root layout:
tsxProps
Appearance
Set appearance to control light, dark, or system preference mode.
Light
Force light mode regardless of system preference.
tsxDark
Force dark mode regardless of system preference.
tsxInherit
Follow system preference (default). Automatically switches between light and dark based on user's OS settings.
tsxAccent Color
Use accentColor to set the primary color for interactive elements like buttons, links, and focus indicators.
Available colors: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky.
tsxtsxGray Color
Use grayColor to set the neutral gray scale for backgrounds and text. The gray color affects the overall tone and contrast of your interface.
Available grays: auto, gray, mauve, slate, sage, olive, sand.
When set to auto, the gray color automatically matches your accent color for a cohesive look.
tsxtsxMaterial
Set material to control panel transparency for depth and visual separation. Use solid for opaque backgrounds or translucent for depth over images or dynamic backgrounds.
Solid
Opaque backgrounds for maximum contrast and clarity.
tsxTranslucent
Translucent backgrounds with blur effects for depth and separation (default).
tsxRadius
Set radius to control the global corner radius scale for all components. This affects buttons, cards, inputs, and other rounded elements.
Available values: none, small, medium (default), large, full.
tsxtsxScaling
Set scaling to control the global size scale for UI density. Use smaller values for compact interfaces or larger values for improved readability and touch targets.
Available values: 90%, 95%, 100% (default), 105%, 110%.
tsxtsxFont Family
Set fontFamily to control the typography system for your app. Each option uses carefully selected font stacks with proper fallbacks.
Available values: sans (default), mono, serif.
tsxtsxNested Themes
You can nest Theme components to override specific settings in parts of your application:
tsxTokens
Use CSS custom properties to access theme values in your styles:
csscsscssEnhancements
Kookie UI extends Radix Themes with practical improvements:
Material Prop
Use material instead of panelBackground for intuitive panel transparency control. Existing panelBackground usage works with migration warnings. All panels automatically respect your material setting.
Effects
Extended blur tokens provide 12-step blur scale for precise backdrop effects. Granular opacity offers 9-step opacity scale for fine-tuned transparency. Specialized 3D button effects create realistic depth and elevation.
Typography
Pre-configured Inter and JetBrains Mono fonts with proper fallbacks prevent browser font weight synthesis issues. Graceful degradation falls back to system fonts if custom fonts fail.
Changelog
Added
materialprop as replacement forpanelBackground- Extended blur token system (12 steps)
- Granular opacity scale (9 steps)
- Enhanced 3D button effects
- Improved font fallback system
Deprecated
panelBackgroundprop in favor ofmaterialprop