Custom Themes
Waveform Playlist uses a comprehensive theming system built on styled-components. Customize every visual aspect of the editor through thetheme prop.
Theme Interface
The complete theme interface is defined in@waveform-playlist/ui-components:
Waveform Colors with Gradients
Waveform colors support both solid colors and gradients:Example: Gradient Waveforms
Waveform Draw Modes
Control how colors are applied to waveforms:Inverted Mode (Default)
Canvas drawswaveOutlineColor in areas without audio. waveFillColor shows through where audio peaks are.
Inverted mode is ideal for gradient bars - the gradient appears in the waveform peaks.
Normal Mode
Canvas drawswaveFillColor bars where audio peaks are. waveOutlineColor is used as background.
Built-in Themes
Two complete themes are exported from@waveform-playlist/ui-components:
Default Theme (Light Mode)
Dark Theme
Creating Custom Themes
Approach 1: Partial Theme
Override only the properties you need:defaultTheme values.
Approach 2: Full Theme
Define a complete theme for total control:Dynamic Theme Switching
Switch themes at runtime:MediaElement Provider Themes
TheMediaElementPlaylistProvider uses the same theming system:
Theme Provider Pattern
How theming works internally
How theming works internally
The theme is applied at the provider level using styled-components
ThemeProvider:- Provider accepts
theme?: Partial<WaveformPlaylistTheme> - Provider merges user theme with
defaultTheme:{ ...defaultTheme, ...userTheme } - Provider wraps children with
<ThemeProvider theme={mergedTheme}> - All styled components access theme via
props.theme.propertyName
Color Format Reference
All color properties accept standard CSS color formats:Best Practices
- Start with a built-in theme - Extend
defaultThemeordarkThemerather than building from scratch - Use RGBA for overlays -
selectionColor,loopRegionColor, andwaveProgressColorshould have transparency - Test selection visibility - Ensure selection color has sufficient contrast with both selected and unselected waveforms
- Consider color blindness - Don’t rely solely on color to distinguish states (use
selectedTrackControlsBackgroundfor additional visual feedback) - Match your app’s design - Use the same color palette and typography as the rest of your application