Skip to main content

Signing Form Web Component

The <docuseal-form> web component renders a fully functional signing form inside your application. Signers can view the document, fill in fields, draw signatures, and submit — all without leaving your page.

Quick start

Add the embed script and drop in the component:
That is all you need to render a working signing form. The sections below cover every available attribute and event.

Attributes

The <docuseal-form> component accepts 39 data-* attributes to control behavior, pre-fill data, and customize the UI.

QuickSign recipe (2-click signing)

Combine data-name on the embed with confirmation_modal mode on the submission for a 2-click signing experience: ESIGN consent → signature carousel → done. Step 1 — Create the submission (server-side):
Step 2 — Embed the signing form (client-side):
What the signer sees:
  1. ESIGN consent modal — “I Agree & Continue”
  2. Bottom-sheet carousel with 2 steps:
    • Signature — auto-generated in Dancing Script cursive from data-name, with REDRAW option
    • Initials — auto-generated from name initials (e.g. “JS”), with REDRAW option
  3. Each signature/initials value is applied to ALL fields of that type across all pages
  4. Pre-filled text fields render as read-only overlays on the document (visible but not editable)
  5. Redirect to completed_redirect_url after submission
data-name vs data-signature: Use data-name for the carousel UX (auto-generates cursive, signer can redraw). Use data-signature to directly pre-fill a specific signature image or text without the carousel. Both work — data-name gives the better interactive experience.
The carousel only triggers when ALL required non-signature fields have values. If required text fields are empty, the form falls back to field-by-field mode. Make sure to pre-fill all required fields via the values parameter.

Full HTML example

This example demonstrates every available attribute:

Events

The <docuseal-form> component emits DOM custom events that you can listen to with addEventListener. Every event provides a detail property on the event object with relevant data.

init

Fired when the web component is initialized and the iframe begins loading.
Event detail: null

load

Fired when the iframe has loaded and the form is ready to render.
Event detail: null

loaded

Fired when the form content has fully rendered and is interactive.
Event detail:

completed

Fired when the signer successfully submits the form.
Event detail:

declined

Fired when the signer declines to sign the document.
Event detail:

field-value

Fired each time the signer fills in or changes a field value.
Event detail:

docutrust:resize

Fired when the form content height changes. Used internally by the web component to auto-resize the iframe. If you use a direct iframe, listen for this event to sync the iframe height. Event detail:

React integration

Use the web component directly in React with a ref for event handling:
Remember to include the embed script in your HTML. In React, add it to your index.html or load it dynamically:

Vue integration

Pre-filling fields

Use data-values to pre-populate form fields. The JSON object maps field names (as defined in the template) to their values.
Use data-signature to pre-fill the signature field. Accepted formats: a base64-encoded image (data:image/png;base64,...), an HTTPS image URL, or plain text that renders as a typed signature.
Supported field types for pre-fill:
Signature, initials, image, file, and stamp fields cannot be pre-filled via data-values. These require the signer to provide them interactively.

Redirect after completion

Use data-completed-redirect-url to send the signer to a custom page after they submit. DocuTrust appends query parameters to the URL so your application can identify the completed submission.
The redirect URL will receive these query parameters:

postMessage events

When the signing form is embedded in an iframe (either via the web component or a raw <iframe>), the form communicates with the parent window via postMessage. Listen for these events to react to signing lifecycle changes without polling.
Use docutrust:completed as the trigger for your backend workflow (e.g. marking the agreement as signed, dispatching follow-up emails). This fires before any redirect, so you can act on it immediately.