Skip to main content
Version: Latest

Configuration

Complete reference for all DragbleConfig / EditorOptions properties passed when initializing the editor.

Initialization Options​

These are the top-level properties passed to dragble.init() or the framework component:

OptionTypeRequiredDefaultDescription
containerIdstringYes—The DOM element ID to mount the editor.
editorKeystringYes—Editor key for authentication (from the Dragble Dashboard). Starts with db_.
editorVersionstringNo'latest'Editor version channel or exact semver. See Version Management.
editorUrlstringNo—Full editor URL override for self-hosting. When set, editorVersion is ignored.
editorMode'email' | 'web' | 'popup'No'email'Builder mode.
designMode'edit' | 'live'No'live'Admin vs end-user permissions.
designDesignJson | nullNo—Initial design to load.
popupPopupConfigNo—Popup builder configuration (required when editorMode is 'popup').
callbacksDragbleCallbacksNo{}Lifecycle and action callbacks. See Callbacks.
optionsEditorOptionsNo{}All editor configuration (see below).

Editor Options​

These are nested under options in the SDK's DragbleConfig:

OptionTypeRequiredDefaultDescription
userUserConfigYes—Current user identity.
localestringNo'en-US'BCP 47 locale for the editor UI (e.g. 'fr-FR', 'de-DE', 'ja-JP'). Supports 29 built-in languages.
translationsRecord<string, Record<string, string>>No{}Custom translation overrides keyed by locale.
textDirection'ltr' | 'rtl'No'ltr'Text direction for the editor UI and content.
mergeTagsMergeTag[]No[]Dynamic merge tags available in the text editor (e.g. {{first_name}}).
designTagsRecord<string, string>No{}Key/value pairs replaced in HTML at export time.
specialLinksSpecialLink[]No[]Custom link types shown in the link picker (e.g. unsubscribe, view-in-browser).
modulesModule[]No[]Reusable modules available in the Modules Library. Categories are normalized to lowercase.
displayConditionsDisplayCondition[]No[]Conditions users can apply to rows for conditional rendering.
appearanceAppearanceConfigNo{}Theme, accent color, and layout settings.
toolsToolsConfigNo{}Show, hide, or lock individual content tools.
customToolsCustomTool[]No[]Register custom content tools.
fontsFontDefinition[]No[]Custom fonts available in the editor.
bodyValuesBodyValuesNo{}Default body-level values (background color, content width, font family).
headerDesignJsonNo—Locked header row rendered above the editable area.
footerDesignJsonNo—Locked footer row rendered below the editable area.
editorEditorConfigNo{}Editor behavior settings.
featuresFeaturesConfigNo{}Enable/disable editor features.
assetStorageAssetStorageConfigNo—Image/file upload configuration.
aiAIConfigNo{ mode: 'disabled' }AI feature configuration. See AI Overview.
callbacksDragbleCallbacksNo{}Lifecycle and action callbacks. See Callbacks.

UserConfig​

interface UserConfig {
id: string;
name: string;
email: string;
avatar?: string; // URL to avatar image
}

AppearanceConfig​

OptionTypeDefaultDescription
theme'light' | 'dark' | 'auto' | 'dragble-light' | 'dragble-dark''light'Editor color theme. auto follows system preference. dragble-* themes use fixed brand colors.
accentColorAccentColor'indigo'Accent color name from Radix UI color scales. See Customize Appearance for the full list.
sidePanelSidePanelConfig{}Side panel configuration (dock, width, tabs, collapsible, etc.).
panelsPanelsConfig{}Legacy panel config — prefer sidePanel.
loaderLoaderConfig—Custom loader configuration (svg > url > html + css > default spinner).
features{ preview?: boolean; undoRedo?: boolean }{}Deprecated — use top-level FeaturesConfig instead.
customStylesRecord<string, string>{}Custom CSS variables.
actionBarActionBarConfig{ placement: 'bottom_right' }Floating action bar for row/content selection.
shortcutBarShortcutBarConfig{ placement: 'top_left' }Floating shortcut bar (preview, undo/redo, responsive toggles).

SidePanelConfig​

Configure the side panel under options.appearance.sidePanel:

interface SidePanelConfig {
dock?: "left" | "right";
width?: number;
collapsible?: boolean;
accordionsCollapsed?: boolean;
tabs?: {
content?: { visible?: boolean };
modules?: { visible?: boolean };
styles?: { visible?: boolean };
};
modulesTab?: {
rows?: { visible?: boolean; defaultExpanded?: boolean };
modulesLibrary?: ModulesLibraryConfig;
};
}

interface ModulesLibraryConfig {
visible?: boolean;
defaultExpanded?: boolean;
title?: string; // default: "Modules Library"
categories?: string[];
defaultCategory?: string;
}

Example:

const config: DragbleConfig = {
options: {
appearance: {
sidePanel: {
modulesTab: {
modulesLibrary: {
title: "Brand Modules",
categories: ["Banner", "POPULAR", "footer"],
defaultCategory: "Banner",
},
},
},
},
},
};

The SDK/editor normalizes module categories to lowercase on load and save. In the example above, "Banner", "banner", and "BANNER" all become banner; the UI displays category labels capitalized.

ToolsConfig​

Controls visibility and behavior of content tools in the sidebar:

interface ToolsConfig {
[key: string]: ToolConfig | undefined;
// Built-in tool keys: paragraph, text, heading, button, image,
// divider, menu, html, social, video, table, timer, form, spacer
}

interface ToolConfig {
enabled?: boolean; // show/hide the tool (default: true)
position?: number; // order in the content panel
properties?: Record<string, ToolPropertyConfig>;
}

interface ToolPropertyConfig {
value?: unknown; // default value for the property
editable?: boolean; // whether the user can edit this property (default: true)
}

EditorConfig​

OptionTypeDefaultDescription
minRowsnumber1Minimum number of rows in the design.
maxRowsnumber | nullnullMaximum number of rows allowed. null means unlimited.
contentType'module'—Set to 'module' to restrict the editor to single-module editing mode.
autoSelectOnDropbooleanfalseAutomatically select a content block after it is dropped into the canvas.
confirmOnDeletebooleanfalseShow a confirmation dialog before deleting rows or content.
rowsbooleantrueShow/hide the Rows accordion in the Modules tab.
titlestring—Title displayed in the editor header area.

FeaturesConfig​

OptionTypeDefaultDescription
previewbooleantrueShow/hide the preview button.
undoRedobooleantrueShow/hide undo/redo buttons.
responsiveDesignbooleantrueShow/hide responsive design toggle.
userUploadsbooleantrueEnable user image uploads.
fileManagerbooleantrueShow File Manager modal. When false, "Choose Image" is hidden but direct upload remains available.
imageEditorbooleanundefinedEnable built-in image cropping/editing. When false, explicitly disables even if the plan allows it. When undefined/true, defers to plan-level permission.
stockImagesboolean | StockImagesConfigtrueEnable stock image browser in the file manager. Pass an object for additional options (safeSearch, defaultSearchTerm).
modulesboolean | ModuleFeaturesConfigfalseEnable modules feature (save row as module, synced modules). Pass an object for granular control (saveRowAsModule).
specialLinksbooleantrueShow special links in the text editor toolbar.
smartMergeTagsbooleanfalseEnable smart merge tags.
languageSelectorbooleantrueShow language selector dropdown in the side panel. When false, language is controlled externally via SDK.
auditbooleanfalseEnable content quality audit checks.
ampbooleanfalseEnable AMP for Email in email mode. When enabled and the plan allows AMP, email mode unlocks interactive tools and exportHtml() returns AMP HTML.
headerbooleanfalseEnable locked header row injected from SDK. Requires plan to allow core.header.
footerbooleanfalseEnable locked footer row injected from SDK. Requires plan to allow core.footer.
preheaderTextbooleantrueShow the preheader text input in the Styles panel (email mode only).
dynamicImagebooleanundefinedEnable dynamic image feature on the image tool. Lets users set merge-tag URLs that replace the image source at send time. When false, explicitly disables even if the plan allows it.
exportExportFeaturesConfig{}Granular export feature toggles: { html?, json?, image?, pdf?, zip?, amp? }.

AssetStorageConfig​

OptionTypeDescription
uploadUrlstringURL to POST image uploads to.
uploadHeadersRecord<string, string>Additional headers sent with upload requests.
onUpload(file: File) => Promise<{ url: string }>Custom upload handler (overrides uploadUrl).
maxFileSizenumberMax file size in bytes (default: 5MB).
acceptedFormatsstring[]Accepted MIME types (default: ['image/png', 'image/jpeg', 'image/gif', 'image/webp']).

AIConfig​

OptionTypeDescription
mode'dragble' | 'external' | 'disabled'AI mode. See AI Overview.
featuresAIFeaturesConfigEnable/disable individual AI features.
callbacksAICallbacksCallback handlers for external mode.

Example: Full Configuration​

const config: DragbleConfig = {
user: { id: "1", name: "Jane Doe", email: "jane@example.com" },
locale: "en-US",
textDirection: "ltr",
mergeTags: [
{ label: "First Name", value: "{{first_name}}" },
{ label: "Company", value: "{{company}}" },
],
appearance: {
theme: "light",
accentColor: "indigo",
},
tools: {
html: { enabled: false },
video: { enabled: false },
},
editor: {
minRows: 1,
maxRows: 50,
confirmOnDelete: true,
},
features: {
userUploads: true,
fileManager: true,
export: { pdf: false },
},
assetStorage: {
onUpload: async (file) => {
const form = new FormData();
form.append("file", file);
const res = await fetch("/api/upload", { method: "POST", body: form });
return res.json();
},
},
ai: { mode: "dragble" },
};
info

Options not specified use their default values. At the top level, containerId and editorKey are required. Within options, only user is required.