Appearance
Options configurable in Topol Options
Topol options are used to set features which Topol provides. Pass them under the config property when creating the editor; callbacks are passed as top-level properties next to config (see the Callbacks Reference below).
Options Reference
authorizeobjectrequiredRequired credentials to initialize the editor securely. Learn more
aiLabeledElementsboolean default: falseAdds an AI content text field to every section and block, stored on the element as aiGenerateContent for your own AI pipeline. Learn more
apiIAPICustom API endpoints for backend integration. Learn more
apiAuthorizationHeaderstring | objectAuthorization header sent with requests to your custom API endpoints. Learn more
autosaveIntervalnumberInterval in seconds between autosave attempts. Learn more
chatAIboolean default: falseAccepted, but the chat panel is not currently exposed in the editor UI - reserved for a future release. Learn more
colorsstring[]Custom color palette for the color picker. Learn more
contentBlocksobjectControls which block types are available (disable or hide individual blocks). Learn more
currentUserIOptionsUserInformation about the current user for comments and collaboration. Learn more
customBlocksarrayCustom block definitions with specific behavior or integrations. Learn more
customFileManagerboolean default: falseEnables custom file manager mode for your own upload workflow. Learn more
customFontsobjectCustom fonts available in the editor. Learn more
defaultTemplateSettingsobjectTypography, colors, and element defaults applied to a newly created page. Learn more
disableAiAssistantboolean default: falseDisables the AI assistant feature. Learn more
disableAlertsboolean default: falseDisables editor alert notifications. Learn more
enableAutosavesboolean default: falseEnables automatic saving at regular intervals. Learn more
enableCommentsboolean default: falseEnables the commenting system for collaboration. Learn more
enableFileManagerInGifboolean default: falseAllows picking GIF images through the file manager. Learn more
fileManagerPreferencesobjectUI preferences for the built-in file manager. Learn more
fontSizesnumber[]Available font sizes in the editor. Learn more
googleApiKeystringAccepted for forward compatibility; not currently used by the editor. Use customFonts to add Google Fonts. Learn more
hideSelectionPanelboolean default: falseCollapses the right-side selection panel (properties of the selected element). Learn more
hideSelectionPanelExpandboolean default: falseHides the expand control on the selection panel. Learn more
hideSettingsTabboolean default: falseHides the settings tab in the editor. Known issue: not applied in the current release. Learn more
hideTopbarControlsstring[]Hides specific controls from the top bar. Learn more
htmlMinifiedboolean default: falseOutputs minified HTML on export. Learn more
imageCompressionOptionsobjectConfigures automatic image compression settings (defaults in the callout below). Learn more
imageEditorOptionsobjectOptions for the built-in image editor, e.g. hiding specific controls. Learn more
imageMaxSizenumber default: 2097152 (2 MB)Maximum allowed image upload size in bytes. Learn more
languagestring default: "en"Editor UI language code (two-letter, from the supported list). Learn more
lightboolean default: falseEnables light theme mode. Learn more
premadeBlocksobject | array | falseConfiguration for the premade design blocks library. Pass false to disable it entirely. Learn more
premadeTemplatesboolean default: falseEnables the premade template library. Learn more
premadeTemplatesOptionsobjectUI options for the premade template library (hideSearch; showDelete is accepted but has no effect). Learn more
removeTopBarboolean default: falseRemoves the top bar completely. Learn more
renameTemplateboolean default: falseEnables template renaming functionality. Learn more
rolestringUser role determining permissions (manager, editor, reader). Learn more
savedBlocksboolean default: falseEnables the saved blocks library. Learn more
showUnsavedDialogBeforeExitboolean default: trueEnabled by default. Set to false to suppress the browser confirmation dialog when leaving with unsaved changes. Learn more
syncedSectionsEnabledboolean default: falseEnables synced sections across multiple pages. Learn more
teamUsersIOptionsUser[]Team members available for @mentions in comments. Learn more
templateIdstring | numberTemplate identifier used for comments and other API features. Learn more
textOverrideobjectCustom text overrides for UI labels. Currently applied only when language is not set. Learn more
themeobject default: dark presetCustom theme configuration for editor appearance. Learn more
titlestringTemplate title shown in the window bar. Only visible when windowBar or renameTemplate is set. Learn more
windowBarstring[]Controls displayed in the window bar. Learn more
Defaults worth knowing
imageCompressionOptionsdefaults:qualityJpeg: 0.95,qualityPng: 0.8,enableAutoResize: true,enableCompression: true.- When
themeis not set, the editor uses the dark preset;theme.preset: "light"also switches thelightoption on, so the two interact. - Supported
languagecodes:en,fr,pt,es,ja,zh,ru,tr,de,sv,nl,it,fi,ro,cs,pl,ko,vi,he,ar. Regional variants such asen-USare not supported - unsupported codes leave the UI in English (the fallback locale). - A few schema-accepted options are not listed above because they currently have no effect:
imageEditoranddisableExtendedComparatorsare never read,helpdeskhas no fields left in its schema and nothing reads the value, andlambdaStageis an internal option for Topol's own staging environments. - The same applies to one callback:
onBannerClickis accepted by the schema but never invoked by the editor.
Callbacks Reference
Callbacks are passed as top-level properties when creating the editor, next to config - not inside the options object:
js
const editor = LandingPageEditor({
config: { authorize: { apiKey: "YOUR_API_KEY", userId: "user-123" } },
onSave(json, html) {
/* ... */
},
});onSave(json, html)Called when user saves the template. json is the template definition, html the rendered page as a string.
onSaveAndClose(json, html)Called when user saves and closes the editor.
onOpenFileManager()Called when file manager should open. Learn more
onImageDelete(items)Called when files or folders are deleted in the file manager, so you can clean up your own storage.
onLoaded()Called after a template passed to load() has been applied.
onInit()Called once the editor is fully initialized and ready.
onUndoChange(count)Called when undo history changes.
onRedoChange(count)Called when redo history changes.
onPreview(html)Called when user triggers preview mode. Receives the rendered HTML as a string.
onPreviewClose()Called when the preview is closed.
onAlert(notification)Called when editor displays an alert. Learn more
onClose()Called when editor is closed.
onEdittedWithoutSaveChanged(hasUnsavedChanges)Called when unsaved changes state changes.
onOpenCustomBlockDialog(customBlock)Called when custom block dialog should open. Learn more
onTemplateRename(title)Called when user renames the template.
onError(type, message, details?)Called when an error occurs in the editor.
TypeScript Interface
Options passed under config:
ts
interface IPluginOptions {
authorize: {
apiKey: string;
userId: string | number;
};
aiLabeledElements?: boolean;
api?: IAPI;
apiAuthorizationHeader?: Record<string, string> | string;
autosaveInterval?: number;
chatAI?: boolean;
colors?: Array<string>;
contentBlocks?: Partial<
Record<
| "text"
| "image"
| "gif"
| "button"
| "divider"
| "spacer"
| "social"
| "video"
| "form"
| "html"
| "raw"
| "custom-raw",
{
disabled?: boolean;
disabledText?: string;
hidden?: boolean;
disabledBadge?: string;
}
>
>;
currentUser?: IOptionsUser;
customBlocks?: TopolCustomBlockData[];
customFileManager?: boolean;
customFonts?: {
override?: boolean;
fonts: Array<IFont>;
};
defaultTemplateSettings?: TopolTemplateSettings;
disableAiAssistant?: boolean;
disableAlerts?: boolean;
enableAutosaves?: boolean;
enableComments?: boolean;
enableFileManagerInGif?: boolean;
fileManagerPreferences?: {
defaultTilesView?: boolean;
hidePexelsIntegration?: boolean;
maxUploadingFiles?: number; // positive integer
};
fontSizes?: Array<number>;
googleApiKey?: string;
hideSelectionPanel?: boolean;
hideSelectionPanelExpand?: boolean;
hideSettingsTab?: boolean;
hideTopbarControls?: Array<string>;
htmlMinified?: boolean;
imageCompressionOptions?: {
qualityJpeg?: number;
qualityPng?: number;
enableAutoResize?: boolean;
enableCompression?: boolean;
};
imageEditorOptions?: {
hideControls?: Array<string>;
};
imageMaxSize?: number;
language?: ILanguage;
light?: boolean;
premadeBlocks?: IOptionsPremadeBlock;
premadeTemplates?: boolean;
premadeTemplatesOptions?: {
hideSearch?: boolean;
showDelete?: boolean;
};
removeTopBar?: boolean;
renameTemplate?: boolean;
role?: "manager" | "editor" | "reader";
savedBlocks?: boolean;
showUnsavedDialogBeforeExit?: boolean;
syncedSectionsEnabled?: boolean;
teamUsers?: IOptionsUser[];
templateId?: number | string;
textOverride?: Record<string, string>;
theme?: ITheme;
title?: string;
windowBar?: Array<string>;
}
type ILanguage =
| "en" | "fr" | "pt" | "es" | "ja" | "zh" | "ru" | "tr" | "de" | "sv"
| "nl" | "it" | "fi" | "ro" | "cs" | "pl" | "ko" | "vi" | "he" | "ar";
interface IOptionsUser {
userId: string; // must be a string here, unlike authorize.userId
name: string;
profilePhotoUrl: string;
}
interface IFont {
label: string;
style: string;
url?: string;
}
// premadeBlocks accepts one of four shapes:
type IOptionsPremadeBlock =
| { blocks: PremadeBlocks | LegacyPremadeBlocks; override: boolean }
| Array<{ id?: number; name: string; blocks: PremadeBlock[] }>
| { content?: unknown; ecomm?: unknown; footers?: unknown; headers?: unknown }
| false; // disables premade blocks entirelyCallbacks are passed as top-level properties alongside config:
ts
interface ILandingPageEditorProps {
config: IPluginOptions;
onSave?(json: object, html: string): void;
onSaveAndClose?(json: object, html: string): void;
onOpenFileManager?(): void;
onImageDelete?(
items: Array<{
name: string;
type: "file" | "folder";
path: string;
url?: string;
key: string | null;
}>
): void;
onLoaded?(): void;
onInit?(): void;
onUndoChange?(count: number): void;
onRedoChange?(count: number): void;
onPreview?(html: string): void;
onPreviewClose?(): void;
onAlert?(notification: INotification): void;
onClose?(): void;
onEdittedWithoutSaveChanged?(hasUnsavedChanges: boolean): void;
onOpenCustomBlockDialog?(customBlock: unknown): void;
onTemplateRename?(title: string): void;
onError?(type: string, message: string, details?: unknown): void;
}Common pitfall
Do not wrap callbacks in a callbacks: { ... } object inside config - the editor ignores that key entirely and no callback will ever fire. Always pass callbacks as top-level properties next to config.
INFO
defaultTemplateSettings nested fields are all optional and merge over the built-in defaults; invalid values are silently dropped rather than raising an error. Learn more
