Components
Complete reference for all 23 JSX components available in docxio.
Document structure​
<document>​
Root element. Maps to w:document.
| Prop | Type | Description |
|---|---|---|
creator | string | Author metadata |
title | string | Document title metadata |
description | string | Subject/description metadata |
keywords | string | Keywords metadata |
styles | DocumentStyles | Custom paragraph and character style definitions |
useDefaultStyles | boolean | Include default Word styles (default: true) |
theme | Theme | Theme preset for document-wide styling |
<section>​
Page layout unit. Maps to w:sectPr.
| Prop | Type | Description |
|---|---|---|
pageSize | { width?: number; height?: number } | Page dimensions in twips |
margins | PageMargins | Page margins (top, right, bottom, left, header, footer, gutter) |
orientation | "portrait" | "landscape" | Page orientation |
columns | number | ColumnDef[] | Number of columns or column definitions |
columnSpace | number | Space between columns in twips |
lineNumbers | object | Line numbering config |
isLastSection | boolean | Suppress trailing page break |
Text content​
<paragraph>​
Maps to w:p.
| Prop | Type | Description |
|---|---|---|
alignment | Alignment | "left", "center", "right", "justify", "start", "end", "both" |
spacing | Spacing | { before?, after?, line?, lineRule? } |
indentation | Indentation | { left?, right?, firstLine?, hanging? } |
style | string | Named paragraph style |
numbering | NumberingProps | List numbering reference |
border | Borders | Paragraph borders |
shading | Shading | Background fill |
keepNext | boolean | Keep with next paragraph |
keepLines | boolean | Keep lines together |
pageBreakBefore | boolean | Page break before |
widowControl | boolean | Widow/orphan control |
outlineLevel | number | Outline level for TOC |
bidi | boolean | Right-to-left direction |
<run>​
Text run. Maps to w:r.
| Prop | Type | Description |
|---|---|---|
bold | boolean | Bold |
italic | boolean | Italic |
underline | UnderlineStyle | boolean | Underline style |
strike | boolean | Strikethrough |
doubleStrike | boolean | Double strikethrough |
fontSize | number | Size in half-points (24 = 12pt) |
fontFamily | string | Font name |
color | string | Hex color (e.g., "FF0000") |
highlight | HighlightColor | Background highlight |
superscript | boolean | Superscript |
subscript | boolean | Subscript |
allCaps | boolean | All capitals |
smallCaps | boolean | Small capitals |
characterSpacing | number | Spacing in twips |
emboss | boolean | Emboss effect |
imprint | boolean | Imprint effect |
shadow | boolean | Shadow |
style | string | Named character style |
bidi | boolean | Right-to-left |
lang | string | Language tag |
<heading>​
Heading paragraph. Maps to w:p + w:pStyle.
| Prop | Type | Description |
|---|---|---|
level | 1-6 | Heading level |
alignment | Alignment | Text alignment |
spacing | Spacing | Paragraph spacing |
numbering | NumberingProps | Numbering reference |
Tables​
<table>​
Maps to w:tbl. See Tables guide.
<row>​
Maps to w:tr. Props: header, height, heightRule, cantSplit.
<cell>​
Maps to w:tc. Props: width, widthType, columnSpan, verticalMerge, verticalAlignment, shading, borders, margins.
Media​
<image>​
Maps to w:drawing. See Images guide.
Props: src (required), width, height, widthPt, heightPt, altText, floating, wrapText, floatPosition, format.
Links and bookmarks​
<hyperlink>​
Maps to w:hyperlink.
| Prop | Type | Description |
|---|---|---|
url | string | External URL |
anchor | string | Internal bookmark name |
tooltip | string | Hover tooltip |
<bookmark>​
Maps to w:bookmarkStart/End.
| Prop | Type | Description |
|---|---|---|
name | string | Required. Bookmark name |
id | string | Unique identifier |
Headers and footers​
<header> / <footer>​
| Prop | Type | Description |
|---|---|---|
type | "default" | "first" | "even" | When this header/footer is displayed |
Lists​
<numbered-list>​
Props: format (NumberingFormat), start (number), reference (string).
<bullet-list>​
Props: reference (string).
<list-item>​
Props: level (0-8), numbering (NumberingProps).
Annotations​
<comment>​
| Prop | Type | Description |
|---|---|---|
author | string | Comment author |
date | string | Comment date |
id | string | Comment ID |
<footnote>​
Props: id (string). Content provided as children.
Fields​
<field>​
Maps to w:fldChar.
| Prop | Type | Description |
|---|---|---|
code | string | Field code: "PAGE", "NUMPAGES", "DATE" |
format | string | Display format |
Breaks and whitespace​
| Component | OOXML | Props |
|---|---|---|
<pagebreak> | w:br type=page | -- |
<linebreak> | w:br | -- |
<columnbreak> | w:br type=column | -- |
<tab> | w:tab | -- |
<tabstop> | w:tabs | position, type, leader |