Component props
Required props
None - the component works with zero configuration.Optional props
Document loading configuration
Field configuration
Field insertion menu configuration
Field list sidebar configuration
Document editing toolbar.
true: render a default toolbar containerstring: CSS selector of an existing element to mount the toolbar intoobject: full toolbar configuration (see ToolbarConfig)
Lock mode for all inserted fields. Per-field
lockMode overrides this. See lock modes.Colors for field types in the document and sidebar. Keys are
fieldType values, values are CSS colors (e.g. { owner: '#629be7', signer: '#d97706' }). Generates scoped CSS automatically: no stylesheet import needed.Content Security Policy nonce for dynamically injected styles
CSS class name for the root container
Inline styles for the root container
Height of the document editor area
Telemetry configuration. Enabled by default with
source: 'template-builder' metadata. See Telemetry for details.License key for SuperDoc. Passed directly to the underlying SuperDoc instance.
Called when the document is loaded and ready
Called when the trigger pattern is typed
Called when a field is inserted
Called when a field is modified
Called when a field is removed
Called whenever the complete field list changes
Called when a field is selected/deselected in the document
Called when user creates a new field (requires
fields.allowCreate = true). Return a modified FieldDefinition to override the field before insertion, or void to use the field as-is.Called when template is exported via
exportTemplate(). Use this to persist field metadata to your database alongside the document.Types
FieldDefinition
Available fields that users can insert:presetContent is applied only for mode: "block" fields. Inline fields ignore it.
TemplateField
Fields that exist in the template document:TriggerEvent
Information about trigger detection:ExportEvent
Data provided when a template is exported:FieldMenuProps
Props passed to custom menu components:FieldListProps
Props passed to custom list components:ExportConfig
Configuration for template export:Ref methods
Access these methods via a ref:insertField()
Insert an inline field at the current cursor position:boolean - true if inserted successfully.
insertBlockField()
Insert a block-level field:boolean - true if inserted successfully.
updateField()
Update an existing field:boolean - true if updated successfully.
deleteField()
Remove a field from the template:boolean - true if deleted successfully. If the deleted field was the last in a group with two members, the remaining field’s group tag is automatically removed.
selectField()
Programmatically select a field:nextField()
Navigate to the next field (equivalent to Tab key):previousField()
Navigate to the previous field (equivalent to Shift+Tab):getFields()
Get all fields in the template:refresh()
Re-discover fields from the editor and triggeronFieldsChange. Use this when field data arrives asynchronously or after external changes to the document:
exportTemplate()
Export the template as a .docx file:Promise<void | Blob> depending on triggerDownload setting.
getSuperDoc()
Access the underlying SuperDoc editor instance:SuperDoc | null.
Field type styling
Use thefieldColors prop to color-code fields by type:

