Skip to main content
Get your template builder up and running in 5 minutes.

Installation

Basic usage

Import the component and styles, then render with minimal props:
That displays an empty document. Type {{ to open the field menu and insert fields.

Load an existing document

Most templates start from an existing document:
The component loads the document and discovers any existing fields.

Add field types

Distinguish between owner-filled and signer-filled fields:
Fields default to 'owner' when no fieldType is specified.

Add preset block content

If a field should insert a predefined structure (for example, a table), add presetContent on a block field:
presetContent applies only to block fields. Inline fields ignore it.
  • presetContent.json is recommended when you need the most reliable preservation of structure, semantics, and editor-compatible styling.
  • With presetContent.html, include required attributes and inline styles explicitly so the HTML parser can map them into node attributes.

Color-code fields in the editor

Import the optional CSS to visually distinguish field types:
Customize colors with CSS variables:

Add the field list sidebar

Show all template fields in a sidebar:
Users can click fields in the list to jump to them in the document.

Handle field changes

Track when fields are inserted, updated, or deleted:
The onFieldsChange callback receives the complete list of fields in the template whenever they change. Each field includes its fieldType.

Export the template

Use a ref to programmatically export:
The exported document contains all field definitions embedded as Structured Document Tags.

TypeScript support

Full TypeScript definitions are included:

Next steps

Configuration Options

Learn about custom components, field creation, and advanced features