RVE LogoReact Video EditorDOCS
RVE SDK/Themes/Themes

Themes

How themes work in the RVE SDK and which CSS variables you can override

The RVE SDK has a theme system for the full editor UI. A theme sets the colors of the panels, backgrounds, borders, timeline items, and controls. You change a theme with CSS variables. You do not change the SDK components.


Built-in Themes

The SDK has three built-in themes:

RVE editor with the Light theme

Light

Theme id: light

RVE editor with the Dark theme

Dark

Theme id: dark (default)

RVE editor with the RVE theme

RVE

Theme id: rve

The editor starts with the dark theme. Use the defaultTheme prop to start with a different theme.


How Theming Works

The theme system has these parts:

  1. The SDK stylesheet (@reactvideoeditor/react-video-editor/styles.css) defines a set of --rve-* CSS variables for each built-in theme.
  2. The editor root element has a data-rve attribute. The SDK sets a data-rve-theme attribute with the active theme id on this element.
  3. Each theme is a CSS rule that matches [data-rve][data-rve-theme='<id>']. The rule sets the values of the --rve-* variables.
  4. All editor components read their colors from the --rve-* variables.
/* The SDK stylesheet contains rules like this one. */
[data-rve][data-rve-theme='dark'] {
  --rve-background: var(--rve-base-950);
  --rve-foreground: var(--rve-base-200);
  --rve-primary: var(--rve-primary-600);
  --rve-border: var(--rve-base-800);
}

The theme attribute is on the editor root only. The SDK does not add a class or an attribute to the <html> element. Thus, the editor theme does not change the rest of your page.

When the user selects a theme in the theme dropdown, the SDK changes the data-rve-theme value. The CSS variables change immediately. The SDK also keeps the selection in localStorage (key rve-extended-theme). On the next load, a valid saved theme replaces defaultTheme.

The SDK stylesheet is precompiled

The SDK stylesheet is a compiled CSS file. You cannot edit the SDK styles.css, the theme files, or the SDK Tailwind configuration in node_modules. To change a theme, add your own CSS file. See Override theme variables.


Tailwind Classes in Your App

The SDK compiles its Tailwind classes with the rve prefix (for example, rve:bg-primary). This prevents conflicts with the Tailwind classes of your app.

Thus, a class such as bg-primary in your app does not use the RVE theme. It uses the theme of your app. If a component of your app must use an RVE color, read the variable directly:

<div style={{ background: 'var(--rve-primary)', color: 'var(--rve-primary-foreground)' }} />

The --rve-* variables have values only inside the editor root element ([data-rve]). Use them only in components that you put inside the editor, for example a customSidebar or a sidebarLogo.


Override Theme Variables

To change a built-in theme or to add a new theme, do these steps:

  1. Create a CSS file in your app.
  2. Write a rule for the theme id. Use the selector [data-rve][data-rve-theme='<id>'].
  3. Import your CSS file after the SDK stylesheet.
rve-overrides.css
/* Change the primary color of the built-in dark theme. */
[data-rve][data-rve-theme='dark'] {
  --rve-primary: hsl(156 80% 40%);
  --rve-ring: hsl(156 80% 40%);
  --rve-sidebar-primary: hsl(156 80% 40%);
}
app/layout.tsx or src/main.tsx
import '@reactvideoeditor/react-video-editor/styles.css';
import './rve-overrides.css';

To add a new theme with its own id, see Whitelabelling.

Use the full selector

Use [data-rve][data-rve-theme='<id>']. A rule on :root or on html does not change the editor, because the SDK sets the variables on the editor root element.


Theme Variable Reference

All variables use the --rve- prefix. Most color variables have a -foreground pair for the text and icons on that color.

Color scales

VariableUse
--rve-base-50 to --rve-base-1000The neutral scale (50, 100, 200 ... 950, 1000). Most surface, text, and border variables refer to this scale.
--rve-primary-50 to --rve-primary-1000The brand color scale. --rve-primary, --rve-ring, and the chart colors refer to this scale.

Core UI colors

VariableUse
--rve-background, --rve-foregroundThe main editor background and text.
--rve-card, --rve-card-foregroundCards and panel sections.
--rve-popover, --rve-popover-foregroundDropdowns, menus, and popovers.
--rve-primary, --rve-primary-foregroundPrimary buttons and active controls.
--rve-secondary, --rve-secondary-foregroundSecondary buttons.
--rve-muted, --rve-muted-foregroundMuted backgrounds and secondary text.
--rve-accent, --rve-accent-foregroundHover and selected states of menu items.
--rve-destructive, --rve-destructive-foregroundDelete actions and errors.
--rve-success, --rve-success-foregroundSuccess states.
--rve-warning, --rve-warning-foregroundWarnings.
--rve-info, --rve-info-foregroundInformation states.
--rve-highlight, --rve-highlight-foregroundThe zoom target handle and the selected animation.
--rve-borderBorders.
--rve-inputInput fields.
--rve-ringFocus rings.
--rve-chart-1 to --rve-chart-5Chart colors in the editor UI.
VariableUse
--rve-sidebar, --rve-sidebar-foregroundThe sidebar background and text.
--rve-sidebar-primary, --rve-sidebar-primary-foregroundThe active sidebar item.
--rve-sidebar-accent, --rve-sidebar-accent-foregroundSidebar hover states.
--rve-sidebar-border, --rve-sidebar-ringSidebar borders and focus rings.

Text, surfaces, and states

VariableUse
--rve-text-primary, --rve-text-secondary, --rve-text-tertiaryThe levels of text emphasis.
--rve-text-disabled, --rve-text-placeholderDisabled text and placeholder text.
--rve-surface, --rve-surface-elevated, --rve-surface-overlaySurface layers.
--rve-interactive-hover, --rve-interactive-pressed, --rve-interactive-disabledHover, pressed, and disabled backgrounds.

Floating toolbar

The floating toolbar is the selection toolbar and the canvas zoom controls.

VariableUse
--rve-floating-toolbar-bg, --rve-floating-toolbar-border, --rve-floating-toolbar-shadowThe toolbar background, border, and shadow.
--rve-floating-toolbar-text, --rve-floating-toolbar-text-hover, --rve-floating-toolbar-hover-bgToolbar icons and hover states.
--rve-floating-toolbar-dividerDividers between toolbar groups.
--rve-floating-toolbar-lock-activeThe active lock button.

Timeline items

VariableUse
--rve-video-overlay, --rve-video-overlay-foregroundVideo items.
--rve-video-item, --rve-video-item-foregroundA video item before its thumbnails load.
--rve-audio-overlay, --rve-audio-overlay-foregroundAudio items.
--rve-text-overlay, --rve-text-overlay-foregroundText items.
--rve-image-overlay, --rve-image-overlay-foregroundImage items.
--rve-caption-overlay, --rve-caption-overlay-foregroundCaption items.
--rve-caption-item, --rve-caption-item-foregroundCaption words in the timeline.
--rve-caption-item-active, --rve-caption-item-active-foregroundThe active caption word.
--rve-waveform-bar, --rve-waveform-bar-foregroundAudio waveform bars.

Timeline

VariableUse
--rve-timeline-marker, --rve-timeline-marker-hoverThe playhead marker.
--rve-timeline-tick, --rve-timeline-tick-hoverRuler ticks.
--rve-timeline-ghostThe ghost item that shows during a drag.
--rve-timeline-rowTrack rows.
--rve-timeline-selected-border, --rve-timeline-item-selected-borderThe borders of selected items.
--rve-timeline-handle-bg, --rve-timeline-handle-indicator, --rve-timeline-handle-hoverThe timeline resize handle.
--rve-keyframe-pink, --rve-keyframe-pink-hover, --rve-keyframe-slateKeyframe markers.

Corner radius

VariableUse
--rve-radiusThe base corner radius (default 9px).

Removed variables

Version 5.14 removed the --rve-sticker-overlay and --rve-sticker-overlay-foreground variables, because the SDK no longer has stickers. If your CSS sets these variables, you can delete those lines.


Summary

  • Themes are sets of --rve-* CSS variables.
  • The SDK sets data-rve-theme on the editor root element, not on <html>.
  • To change a theme, import your own CSS file after the SDK stylesheet.
  • Use the selector [data-rve][data-rve-theme='<id>'].
  • The SDK Tailwind classes have the rve prefix, so the Tailwind classes of your app do not change.