Skip to content

Signature Block ​

Renders signature lines for contracts, approvals, and formal documents. Each party gets a cell in a borderless table with a bold label, signature line, and optional date.

Import ​

ts
import { signatureBlockPlugin, type SignatureBlockOptions, type SignatureParty } from 'docx-kit'

Options ​

OptionTypeDefaultDescription
partiesSignatureParty[](required)The signing parties
columnsnumber2Maximum columns, capped at the number of parties

SignatureParty ​

FieldTypeDescription
labelstringParty label (e.g. "甲方(盖章)")
datestringPre-filled date (e.g. "2026年 月 日")
namestringPre-filled name (shown underlined when provided)

Examples ​

Two-Party Contract ​

ts
import { createDocx, signatureBlockPlugin } from 'docx-kit/node'

const doc = createDocx()
  .use(signatureBlockPlugin())
  .h1('Service Agreement')
  .p('The parties agree to the following terms and conditions...')
  .p('Signed:')
  .plugin('signatureBlock', {
    parties: [
      { label: '甲方(盖章)', name: '张三', date: '2026年  月  日' },
      { label: '乙方(盖章)', name: '李四', date: '2026年  月  日' },
    ],
  })
  .save('contract.docx')

Three-Column Layout ​

ts
const doc = createDocx()
  .use(signatureBlockPlugin())
  .h1('Approval Sheet')
  .plugin('signatureBlock', {
    columns: 3,
    parties: [
      { label: '申请人', name: '王五' },
      { label: '部门经理', date: '2026年  月  日' },
      { label: '总经理', date: '2026年  月  日' },
    ],
  })
  .save('approval.docx')

Without Pre-Filled Names ​

ts
const doc = createDocx()
  .use(signatureBlockPlugin())
  .h1('NDA Agreement')
  .plugin('signatureBlock', {
    parties: [
      { label: 'Disclosing Party', date: 'Date: ____________' },
      { label: 'Receiving Party', date: 'Date: ____________' },
    ],
  })
  .save('nda.docx')

Single Party ​

ts
const doc = createDocx()
  .use(signatureBlockPlugin())
  .h1('Acknowledgment Form')
  .p('I acknowledge that I have received and read the employee handbook.')
  .plugin('signatureBlock', {
    parties: [
      { label: 'Employee Signature', name: 'Jane Smith', date: '2026-06-11' },
    ],
  })
  .save('acknowledgment.docx')

Four Parties in Two Rows ​

ts
const doc = createDocx()
  .use(signatureBlockPlugin())
  .h1('Multi-Party Agreement')
  .plugin('signatureBlock', {
    columns: 2,
    parties: [
      { label: 'Party A', name: 'Alice', date: '2026-06-11' },
      { label: 'Party B', name: 'Bob', date: '2026-06-11' },
      { label: 'Party C', name: 'Carol', date: '2026-06-11' },
      { label: 'Party D', name: 'David', date: '2026-06-11' },
    ],
  })
  .save('multi-party.docx')

Style customization ​

Pass { styles } to the factory for instance defaults, and options.styles for invocation overrides. The package and docx-kit entry points export SignatureBlockConfig and SignatureBlockStyles. Priority: built-in/theme defaults → initialization styles → common node style → invocation part styles. Nested fields merge; arrays replace; undefined retains defaults; 0 and false apply. Units and theme tokens such as $colors.primary are supported.

PartsStyle typeScope
date, emptyText, label, signatureTextStyleRuleRun typography
dateParagraph, emptyParagraph, labelParagraph, paddingParagraph, signatureParagraphParagraphStyleRuleBackground, borders, alignment, spacing and flow
cellOmit<CellStyleRule, 'height'>Cell shading, borders, width and padding
ts
signatureBlockPlugin({
  styles: { signature: { color: '#2563EB', fontSize: 14 } },
})

Use the same part names in options.styles for a single call. JSON DSL, AI tool schemas and MCP validation share these contracts; unknown parts and misplaced properties are rejected.

Released under the MIT License.