Theming
X-UI provides a powerful theming system with dark/light mode support and CSS variables.
ThemeProvider
Wrap your app with ThemeProvider to enable theming. It handles theme persistence automatically.
Props
| Prop | Type | Default |
|---|---|---|
defaultTheme | 'light' | 'dark' | 'light' |
storageKey | string | 'x-ui-theme' |
children | ReactNode | - |
useXTheme Hook
Access and control the current theme using the useXTheme hook.
Returns
themeThemeConfig object with colors and glass tokensmodeCurrent theme mode ('light' | 'dark')setModeFunction to set specific theme modetoggleModeFunction to toggle between light/dark
CSS Variables
X-UI uses CSS custom properties for theming. You can use these in your own styles.
Mode-Specific Styles
Target specific theme modes using CSS class selectors.