Skip to main content
Complete guide to configuring the template builder component.

Document options

Control which document is loaded and how users interact with it:
Editing mode - Users can edit document content and insert fields. Viewing mode - Read-only document display, fields can still be inserted.

Field system

Available fields

Define which fields users can insert:

Field types

Tag fields with a fieldType to distinguish roles:
Import the optional CSS to color-code fields in the editor:
Customize colors with CSS variables:
The fieldType value flows through all callbacks (onFieldInsert, onFieldsChange, onExport, etc.) and is stored in the SDT tag metadata.

Field creation

Allow users to create new fields while building templates:
When enabled, the field menu shows a “Create New Field” option with inputs for name, mode (inline/block), and field type (owner/signer).

Linked fields

When a user selects an existing field from the “Existing Fields” section in the menu, a linked copy is inserted. Both instances share a group ID and stay in sync. The menu automatically groups existing fields and shows the count. When the last field in a group is deleted, the remaining field’s group tag is removed.

Trigger pattern

Change what opens the field insertion menu:

Custom menu component

Replace the default field menu entirely:
The component handles trigger detection, filtering, and positioning. You render the UI.

List sidebar

Position and visibility

Omit list prop entirely to hide the sidebar.

Custom list component

Replace the default sidebar:

Toolbar configuration

Control the document editing toolbar:

Event handlers

Field lifecycle events

Selection and interaction

Export event

Document ready

Telemetry

Telemetry is enabled by default with source: 'template-builder' metadata. You can override or extend the defaults:
To disable telemetry:
For more details on how telemetry works, see the Telemetry page.

License key

Pass licenseKey to identify your organization in telemetry:
The key is used solely for organization identification. It does not enable or disable any features, and nothing is blocked if a usage quota is reached. The key is forwarded to the underlying SuperDoc instance.

Complete example

Putting it all together:

Styling

The component uses CSS classes you can target:
Import superdoc/style.css for proper rendering. Optionally import @superdoc-dev/template-builder/field-types.css for field type color-coding.