IEditorOption interface. This guide covers all available configuration options for customizing the editor’s behavior and appearance.
Basic Setup
When initializing the editor, you can pass configuration options as the third parameter:Editor Modes
Controls the editor’s operational mode.Available modes from
src/editor/dataset/enum/Editor.ts:17:EDIT- Full editing mode with all features enabledCLEAN- Hides auxiliary elements for clean viewREADONLY- Document is read-only, no editing allowedFORM- Only form controls are editablePRINT- Print mode with hidden auxiliary elementsDESIGN- Design mode ignoring readonly/deletable rulesGRAFFITI- Graffiti mode for freehand drawing
Default Text Styling
Configure default text appearance for new content.Default font family for text content.
Default font size in pixels.
Default text color (CSS color format).
Default content type.
Minimum allowed font size.
Maximum allowed font size.
Page Layout
Page width in pixels.
Page height in pixels.
Page margins as
[top, right, bottom, left] array in pixels.Type definition from src/editor/interface/Margin.ts:1:Controls page layout mode:
PageMode.PAGING- Traditional paged layoutPageMode.CONTINUITY- Continuous scroll layout
Paper orientation:
PaperDirection.VERTICAL- Portrait orientationPaperDirection.HORIZONTAL- Landscape orientation
Gap between pages in pixels (for paged mode).
Rendering Configuration
Display scale factor (zoom level).
Rendering optimization mode:
RenderMode.SPEED- Optimized for performanceRenderMode.COMPATIBILITY- Better browser compatibility
Pixel ratio for print output quality.
Text Behavior
Word breaking behavior:
WordBreak.BREAK_ALL- Break anywhereWordBreak.BREAK_WORD- Break at word boundaries
Default basic row margin height.
Default row margin.
Default tab character width.
Selection and Highlighting
Selection range color.
Selection range opacity (0-1).
Minimum width for selection range.
Highlight overlay opacity (0-1).
Vertical margin for highlight areas.
Search Configuration
Background color for search matches.
Background color for the active search match.
Opacity for search match highlighting (0-1).
Text Decorations
Default underline color.
Default strikethrough color.
Default color for hyperlinks.
Resizer and Indicators
Color of element resizer handles.
Size of resizer handles in pixels.
Size of margin indicators.
Color of margin indicators.
Interaction Configuration
Opacity for inactive elements (0-1).
Maximum number of undo/redo history records.
CSS selector for custom scroll container.
Disable selection outside page boundaries.
Feature Restrictions
Array of context menu keys to disable.
Array of keyboard shortcut keys to disable.
Custom character classes for text processing.
Advanced Options
Margins for mask overlay as
[top, right, bottom, left].Locale code for internationalization (e.g., ‘en’, ‘zh-CN’).
Component Options
The editor supports extensive configuration for various components:Table Options
Configure table appearance and behavior
Header & Footer
Customize header and footer sections
Watermark
Add and configure watermarks
Page Numbers
Configure page numbering
Table Configuration
Configuration for table elements.
src/editor/interface/table/Table.ts:3:
Header & Footer
Header section configuration (from
src/editor/interface/Header.ts:3).Footer section configuration (similar structure to header).
Watermark
Watermark configuration (from
src/editor/interface/Watermark.ts:4).Page Numbers
Page numbering configuration (from
src/editor/interface/PageNumber.ts:4).Additional Component Options
Control Options
Control Options
Form control appearance and behavior.
Checkbox & Radio
Checkbox & Radio
More Options
More Options
cursor: Cursor appearance configurationtitle: Document title configurationplaceholder: Placeholder text configurationgroup: Element grouping optionspageBreak: Page break configurationzone: Zone-specific settingsbackground: Background configurationlineBreak: Line break behaviorwhiteSpace: Whitespace renderingseparator: Separator line stylinglineNumber: Line numbering configurationpageBorder: Page border stylingbadge: Badge element configurationgraffiti: Graffiti mode settingslabel: Label element configurationimgCaption: Image caption defaultslist: List element configuration
Mode Rules
Special rules for different editor modes (from
src/editor/interface/Editor.ts:168).Complete Configuration Example
Runtime Configuration Updates
To update configuration at runtime, use the appropriate command methods:Next Steps
Styling Guide
Learn about styling and theming
Data Structure
Understand the document data format
API Reference
Explore all available API methods
Examples
See real-world implementation examples