Skip to content

Plugins ​

docx-kit currently ships with 25 built-in plugins. Each plugin lives in its own workspace package under packages-plugins/, can be registered with .use(...), and is invoked through .plugin(name, options).

Catalog ​

PluginPackageNode NameDescription
Cross Reference@docxkit/plugin-cross-referencecrossReferenceBookmark text, number and page references
Bibliography@docxkit/plugin-bibliographybibliographyNumeric source lists and linked citations
Glossary@docxkit/plugin-glossaryglossarySorted and grouped terminology tables
Badge@docxkit/plugin-badgebadgeStatus chips and short labels
Barcode@docxkit/plugin-barcodebarcodeCode 128, EAN, UPC, and other linear barcodes
Callout@docxkit/plugin-calloutcalloutInfo, warning, success, and danger boxes
Changelog@docxkit/plugin-changelogchangelogRelease-note tables with typed entries
Code Block@docxkit/plugin-code-blockcodeBlockMonospaced source blocks with optional highlighting
Cover Page@docxkit/plugin-cover-pagecoverPageProfessional title and report covers
Data Table@docxkit/plugin-data-tabledataTableObject-array tables with formatting helpers
Divider@docxkit/plugin-dividerdividerHorizontal rules and section separators
ECharts@docxkit/plugin-echartsechartsEmbedded ECharts charts
Invoice@docxkit/plugin-invoiceinvoiceInvoice layouts with totals and tax calculation
Letterhead@docxkit/plugin-letterheadletterheadBranded company headers for formal letters
Meeting Minutes@docxkit/plugin-meeting-minutesmeetingMinutesStructured meeting summaries
Page Number@docxkit/plugin-page-numberpageNumberCurrent page or page X of Y fields
Property Table@docxkit/plugin-property-tablepropertyTableKey-value metadata tables
QR Code@docxkit/plugin-qrcodeqrcodeQR code images from text or URLs
Checklist@docxkit/plugin-checklistchecklistGrouped native Word checkboxes
Figure@docxkit/plugin-figurefigureImages with captions and source credits
Metric Card@docxkit/plugin-metric-cardmetricCardMulti-column metric summaries
Signature Block@docxkit/plugin-signature-blocksignatureBlockSignature grids for approvals and contracts
Timeline@docxkit/plugin-timelinetimelineChronological milestone rendering
Table of Contents@docxkit/plugin-toctocWord TOC fields based on headings
Watermark@docxkit/plugin-watermarkwatermarkSimple textual watermarks

Shared Usage Pattern ​

ts
import { createDocx, calloutPlugin } from 'docx-kit'

const doc = createDocx()
  .use(calloutPlugin())
  .plugin('callout', {
    type: 'info',
    title: 'Heads up',
    content: 'This report is generated automatically.',
  })

Compatibility Notes ​

PluginExtra dependency or runtime note
crossReferenceWord fields need refreshing; previews use cached fallback text
barcodeRequires the bwip-js package
codeBlockOptional highlight.js peer dependency for syntax coloring
echartsRequires echarts; browser DOM is the primary target
qrcodeRequires the qrcode package
tocWord usually asks to update fields after opening the generated .docx
pageNumberMost useful when inserted into headers or footers

How To Choose ​

  • Use content plugins like callout, codeBlock, badge, and divider when you need presentational blocks inside a normal document flow.
  • Use document-structure plugins like coverPage, toc, pageNumber, and letterhead when you want reusable report scaffolding.
  • Use data plugins like dataTable, propertyTable, timeline, invoice, and meetingMinutes when your source data already has a clear schema.
  • Use media plugins like barcode, echarts, and qrcode when the document needs scannable or visual output.

Custom plugins are still supported through definePlugin(). See the Plugins guide and the package catalog for the package-level view.

Released under the MIT License.