This component allows you to seamlessly integrate an entire document creation and signing form anywhere on your website or application. It supports JS+HTML, Vue, Angular and React.

import React, { useState, useEffect } from 'react';
import { DocusealBuilder } from '@docuseal/react'

const App = () => {
  const [token, setToken] = useState();

  useEffect(() => {
    fetch('/api/docuseal/builder_token', {
      method: 'POST',
    })
      .then((response) => response.json())
      .then((data) => {
        setToken(data.token);
      });
  }, []);

  return token && <DocusealBuilder token={token} />;
};
View LIVE DEMO

Attributes

token String required

JSON Web Token (JWT HS256) with a payload signed using the API key.
Ensure that the JWT token is generated on the backend to prevent unauthorized access to your documents.

user_email String required

Email of the owner of the API signing key - admin user email.

integration_email String

Email of the user to create a template for.

Example: signer@example.com

template_id Number

ID of the template to open in the form builder. Optional when `document_urls` are specified.

host String

DocuSeal host domain name. Only use this attribute if you are using the on-premises DocuSeal installation or docuseal.eu Cloud.

Example: yourdomain.com

customButton Object

Custom button will be displayed on the top right corner of the form builder.

title String required

Custom button title.

url String required

Custom button URL. Only absolute URLs are supported.

roles Array

Submitter role names to be used by default in the form.

fieldTypes Array

Field type names to be used in the form builder. All field types are used by default.

Possible values: heading, text, signature, initials, date, datenow, number, image, checkbox, multiple, file, radio, select, cells, stamp, payment, phone, verification, kba, strikethrough

dateFormats Array

A list of formats to be used for the date field. Formats may include date ('YYYY', 'MM', 'DD'), time ('HH', 'hh', 'mm', 'ss', 'A') and timezone ('z') parts. The first format in the list is used as the default.

Example: ["MM/DD/YYYY", "YYYY-MM-DD HH:mm:ss z"]

drawFieldType String

Field type to be used by default with the field drawing tool.

Default: text

Example: signature

fields Array

An array of default custom field properties with `name` to be added to the document.

Child parameters

name String required

Field name.

type String

Field type.

Possible values: heading, text, signature, initials, date, number, image, checkbox, multiple, file, radio, select, cells, stamp, payment, phone, verification, kba, strikethrough

role String

Submitter role name for the field.

submitters Array

An array of default submitters with `role` name to be added to the document.

Child parameters

email String

Submitter email.

role String required

Submitter role name.

name String

Submitter name.

requiredFields Array

An array of default required custom field properties with `name` that should be added to the document.

Child parameters

name String required

Field name.

type String

Field type.

Possible values: heading, text, signature, initials, date, number, image, checkbox, multiple, file, radio, select, cells, stamp, payment, phone, verification, kba, strikethrough

role String

Submitter role name for the field.

emailMessage Object

Email subject and body for the signature request.

subject String required

Email subject for the signature request.

body String required

Email body for the signature request.

withTitle Boolean

Set `false` to remove document title from the builder.

Default: true

withSendButton Boolean

Show the "Send" button.

Default: true

withUploadButton Boolean

Show the "Upload" button.

Default: true

withAddPageButton Boolean

Show the "Add Blank Page" button.

Default: false

withSignYourselfButton Boolean

Show the "Sign Yourself" button.

Default: true

withDocumentsList Boolean

Set `false` to not show the documents list on the left. Documents list is displayed by default.

Default: true

withDynamicDocuments Boolean

Set `true` to allow converting DOCX files to editable dynamic documents.

Default: false

withFieldsList Boolean

Set `false` to not show the fields list on the right. Fields list is displayed by default.

Default: true

withFieldsDetection Boolean

Display a button to automatically detect and add fields to the document with AI.

Default: false

withCustomFieldsTab Boolean

Set `true` to display a separate "Custom" fields tab in the fields list. Custom fields can be configured using the `fields` or `requiredFields` prop.

Default: false

withFieldPlaceholder Boolean

Set `true` to display field name placeholders instead of the field type icons.

Default: false

withSignatureId Boolean

Set to `true` to enable Signature ID by default for newly added fields. If set to `false`, the Signature ID toggle will be displayed under field settings, with the Signature ID turned off by default.

onlyDefinedFields Boolean

Allow to add fields only defined in the `fields` prop.

Default: false

preview Boolean

Show template in preview mode without ability to edit it.

Default: false

inputMode Boolean

Open template in data input mode to prefill fields with default values.

Default: false

autosave Boolean

Set `false` to disable form changes autosaving.

Default: true

language String

UI language, 'en', 'es', 'de', 'fr', 'pt', 'nl', 'he', 'ar' languages are available.

Default: en

i18n Object

Object that contains i18n keys to replace the default UI text with custom values. See template_builder/i18n.js for available i18n keys.

Default: {}

backgroundColor String

The form builder background color. Only HEX color codes are supported.

Example: #ffffff

customCss String

Custom CSS styles to be applied to the form builder.

Example: #sign_yourself_button { background-color: #FFA500; }

Callbacks

onLoad Function

Function to be called on loading the form builder template data.

Example: (data) => { console.log(data) }

onUpload Function

Function to be called on uploading a document to the template.

Example: (data) => { console.log(data) }

onSend Function

Function to be called on sending documents for signature to recipients.

Example: (data) => { console.log(data) }

onChange Function

Function to be called when changes are made to the template form.

Example: (data) => { console.log(data) }

onSave Function

Function to be called on saving changes of the template form.

Example: (data) => { console.log(data) }

Live Example