Skip to main content

Customize Appearance

Control the editor's visual theme, accent color, panel layout, and loader. Configuration can be set at init time or changed at runtime.

import { useRef } from 'react';
import { PexelizeEditor, PexelizeEditorRef } from '@pexelize/react-editor';

function ThemedEditor() {
const editorRef = useRef<PexelizeEditorRef>(null);

return (
<PexelizeEditor
ref={editorRef}
editorKey="pk_your_key"
editorMode="email"
options={{
appearance: {
theme: 'dark',
accentColor: 'indigo',
},
}}
/>
);
}

You should see the editor render with a dark background and indigo-tinted controls.

Themes

Four built-in themes are available:

ThemeDescription
'light'Generic light theme with customizable accent color
'dark'Generic dark theme with customizable accent color
'pexelize-light'Pexelize branded light theme (fixed indigo accent)
'pexelize-dark'Pexelize branded dark theme (fixed gray/white accent)

The light and dark themes respect the accentColor setting. The pexelize-light and pexelize-dark themes use fixed brand colors and ignore accentColor.

Accent colors

25 accent colors are available, based on Radix UI color scales:

graygoldbronzebrownyellow
amberorangetomatoredruby
crimsonpinkplumpurpleviolet
irisindigobluecyanteal
jadegreengrassmintsky

Set accent color at init or at runtime:

// At init (via options)
options: {
appearance: {
accentColor: 'violet',
},
}

// At runtime
editor.setAppearance({ accentColor: 'violet' });

Change theme at runtime

Call setAppearance() to switch themes without reloading the editor:

const toggleTheme = () => {
editorRef.current?.editor?.setAppearance({
theme: 'dark',
accentColor: 'cyan',
});
};

You should see the editor immediately switch to the new theme and accent color.

Panel layout

Control the side panel position, width, and collapsibility:

options: {
appearance: {
sidePanel: {
dock: 'right', // 'left' | 'right' (default: 'right')
width: 380, // Panel width in pixels (default: 380)
collapsible: true, // Allow user to collapse (default: false)
accordionsCollapsed: false, // Start accordion sections expanded (default: false)
tabs: {
content: { visible: true }, // Content tools tab
modules: { visible: true }, // Modules/rows tab
styles: { visible: true }, // Styles tab
},
},
},
}

Feature visibility

Show or hide the preview and undo/redo buttons:

options: {
appearance: {
features: {
preview: true, // Show preview button (default: true)
undoRedo: true, // Show undo/redo buttons (default: true)
},
},
}

Action bar placement

Move the floating action bar that appears when a row or content is selected:

options: {
appearance: {
actionBar: {
placement: 'top_right', // 'top' | 'bottom' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right'
compact: false, // Smaller buttons (default: false)
},
},
}

Custom loader

Replace the default loading spinner with your own:

options: {
appearance: {
loader: {
// Option 1: Image URL (GIF, PNG, SVG, etc.)
url: 'https://example.com/loading.gif',

// Option 2: Inline SVG
svg: '<svg viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="none" stroke="#6366f1" stroke-width="4"><animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="1s" repeatCount="indefinite"/></circle></svg>',

// Option 3: Custom HTML + CSS
html: '<div class="my-loader">Loading...</div>',
css: '.my-loader { font-size: 18px; color: #6366f1; }',
},
},
}

Priority: svg > url > html + css > default spinner.

Full appearance config

options: {
appearance: {
theme: 'light',
accentColor: 'indigo',
features: {
preview: true,
undoRedo: true,
},
actionBar: {
placement: 'top',
compact: false,
},
sidePanel: {
dock: 'right',
width: 380,
collapsible: false,
accordionsCollapsed: false,
tabs: {
content: { visible: true },
modules: { visible: true },
styles: { visible: true },
},
},
loader: {
url: 'https://example.com/loading.gif',
},
},
}

Method reference

MethodReturnsDescription
setAppearance(config)voidUpdate appearance at runtime (theme, accent, panels, etc.)

Next steps