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.

React
tsx


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

  return (
    <DragbleEditor
      ref={editorRef}
      editorKey="db_your_key"
      editorMode="email"
      options={{
        appearance: {
          theme: "dark",
          accentColor: "indigo",
        },
      }}
    />
  );
}
Vue
plaintext
<template>
  <DragbleEditor
    ref="editorRef"
    editor-key="db_your_key"
    editor-mode="email"
    :appearance="{
      theme: 'dark',
      accentColor: 'indigo',
    }"
  />
</template>

<script setup lang="ts">


const editorRef = ref<InstanceType<typeof DragbleEditor>>();
</script>
Angular
typescript



@Component({
  selector: "app-themed-editor",
  standalone: true,
  imports: [DragbleEditorComponent],
  template: `
    <dragble-editor
      #editor
      editorKey="db_your_key"
      editorMode="email"
      [appearance]="appearance"
    ></dragble-editor>
  `,
})
export class ThemedEditorComponent {
  @ViewChild("editor") editorComp!: DragbleEditorComponent;

  appearance: AppearanceConfig = {
    theme: "dark",
    accentColor: "indigo",
  };
}
Vanilla JS
typescript
dragble.init({
  containerId: "editor-container",
  editorKey: "db_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
'dragble-light'Dragble branded light theme (fixed indigo accent)
'dragble-dark'Dragble branded dark theme (fixed gray/white accent)

The light and dark themes respect the accentColor setting. The dragble-light and dragble-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:

typescript
// 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:

React
tsx
const toggleTheme = () => {
  editorRef.current?.editor?.setAppearance({
    theme: "dark",
    accentColor: "cyan",
  });
};
Vue
typescript
function toggleTheme() {
  editorRef.value?.setAppearance({
    theme: "dark",
    accentColor: "cyan",
  });
}
Angular
typescript
toggleTheme() {
  this.sdk?.setAppearance({
    theme: 'dark',
    accentColor: 'cyan',
  });
}
Vanilla JS
typescript
dragble.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:

typescript
options: {
  appearance: {
    sidePanel: {
      dock: 'right',           // 'left' | 'right' (default: 'right')
      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:

typescript
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:

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

Shortcut bar placement

Position the floating shortcut bar (preview, undo/redo, responsive design toggles) in the workspace:

typescript
options: {
  appearance: {
    shortcutBar: {
      placement: 'top_left',  // 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right' (default: 'top_left')
    },
  },
}

Custom loader

Replace the default loading spinner with your own:

typescript
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

typescript
options: {
  appearance: {
    theme: 'light',
    accentColor: 'indigo',
    features: {
      preview: true,
      undoRedo: true,
    },
    actionBar: {
      placement: 'bottom_right',
      compact: false,
    },
    shortcutBar: {
      placement: 'top_left',
    },
    sidePanel: {
      dock: 'right',
      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