ThemeSelector component provides a dropdown interface for users to switch between available editor themes. It integrates with the EditorContext to update the selected theme.
Usage
Features
- Displays all available themes from the
THEMESarray - Updates the editor theme in real-time when selection changes
- Synchronized with EditorContext state
- Visual paintbrush icon indicator
- Transparent background that adapts to current theme
Props
The ThemeSelector component doesn’t accept any props. It uses theuseEditor() hook internally to access and update theme state.
Context Dependencies
Current theme ID from EditorContext
Function to update the selected theme
Implementation
The component renders a native<select> element with options generated from the THEMES array:
src/components/theme-selector.tsx
Integration Example
ThemeSelector is typically used within the InfoBar component at the bottom of the editor:Related
- Theme System - Available themes and configuration
- EditorContext - State management integration
- InfoBar Component - Parent component