Skip to main content
Version: 1.0.0

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
containerIdstringYesThe DOM element ID to mount the editor.
editorKeystringYesEditor key for authentication (from the Dragble Dashboard). Starts with db_.
editorVersionstringNo'latest'Editor version channel or exact semver. See Version Management.
editorUrlstringNoFull 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 | nullNoInitial design to load.
popupPopupConfigNoPopup 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
userUserConfigYesCurrent 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 content modules available in the content panel.
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).
headerDesignJsonNoLocked header row rendered above the editable area.
footerDesignJsonNoLocked footer row rendered below the editable area.
editorEditorConfigNo{}Editor behavior settings.
featuresFeaturesConfigNo{}Enable/disable editor features.
assetStorageAssetStorageConfigNoImage/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.
loaderLoaderConfigCustom 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).

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.
titlestringTitle 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.