Overview
Yoopta UI ships with a lightweight theme system based on CSS variables (shadcn/ui style). You get:ThemeProvider– manages resolved theme (light,dark,system)useTheme()– hook for reading/setting themeThemeToggle– ready-to-use button for switching themes

Quick Start
Components & Hooks
ThemeProvider
Wrap your app (or editor) with this provider to sync theme state.
Props:
defaultTheme?: 'light' | 'dark' | 'system'(defaultsystem)storageKey?: string(default'yoopta-ui-theme')
useTheme()
Access theme state and helpers.
theme | Current stored preference ('light' | 'dark' | 'system') |
| resolvedTheme | Actual applied mode after resolving system preference |
| setTheme(theme) | Set explicit theme |
| toggleTheme() | Switch between light/dark |
ThemeToggle
Ready-made toggle button using useTheme() internally.
CSS Variables
All UI components use shared variables defined on:root. You can override them globally, per theme, or per component.
Base variables
Dark mode
Component-specific variables
Each component exposes its own CSS vars (see respective docs). Example forFloatingBlockActions:
Using Tailwind
If you use Tailwind, you can target the generated classes directly:Example theme config
Persisting Theme
ThemeProvider stores the chosen theme in localStorage (configurable via storageKey). On first render, it reads system preference via window.matchMedia('(prefers-color-scheme: dark)').
Best Practices
Wrap editor with ThemeProvider
Wrap editor with ThemeProvider
Keep theme in sync with app shell
Keep theme in sync with app shell
Support system preference by default
Support system preference by default