Skip to main content

Components

Complete reference for all 23 JSX components available in docxio.

Document structure​

<document>​

Root element. Maps to w:document.

PropTypeDescription
creatorstringAuthor metadata
titlestringDocument title metadata
descriptionstringSubject/description metadata
keywordsstringKeywords metadata
stylesDocumentStylesCustom paragraph and character style definitions
useDefaultStylesbooleanInclude default Word styles (default: true)
themeThemeTheme preset for document-wide styling

<section>​

Page layout unit. Maps to w:sectPr.

PropTypeDescription
pageSize{ width?: number; height?: number }Page dimensions in twips
marginsPageMarginsPage margins (top, right, bottom, left, header, footer, gutter)
orientation"portrait" | "landscape"Page orientation
columnsnumber | ColumnDef[]Number of columns or column definitions
columnSpacenumberSpace between columns in twips
lineNumbersobjectLine numbering config
isLastSectionbooleanSuppress trailing page break

Text content​

<paragraph>​

Maps to w:p.

PropTypeDescription
alignmentAlignment"left", "center", "right", "justify", "start", "end", "both"
spacingSpacing{ before?, after?, line?, lineRule? }
indentationIndentation{ left?, right?, firstLine?, hanging? }
stylestringNamed paragraph style
numberingNumberingPropsList numbering reference
borderBordersParagraph borders
shadingShadingBackground fill
keepNextbooleanKeep with next paragraph
keepLinesbooleanKeep lines together
pageBreakBeforebooleanPage break before
widowControlbooleanWidow/orphan control
outlineLevelnumberOutline level for TOC
bidibooleanRight-to-left direction

<run>​

Text run. Maps to w:r.

PropTypeDescription
boldbooleanBold
italicbooleanItalic
underlineUnderlineStyle | booleanUnderline style
strikebooleanStrikethrough
doubleStrikebooleanDouble strikethrough
fontSizenumberSize in half-points (24 = 12pt)
fontFamilystringFont name
colorstringHex color (e.g., "FF0000")
highlightHighlightColorBackground highlight
superscriptbooleanSuperscript
subscriptbooleanSubscript
allCapsbooleanAll capitals
smallCapsbooleanSmall capitals
characterSpacingnumberSpacing in twips
embossbooleanEmboss effect
imprintbooleanImprint effect
shadowbooleanShadow
stylestringNamed character style
bidibooleanRight-to-left
langstringLanguage tag

<heading>​

Heading paragraph. Maps to w:p + w:pStyle.

PropTypeDescription
level1-6Heading level
alignmentAlignmentText alignment
spacingSpacingParagraph spacing
numberingNumberingPropsNumbering 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.

Maps to w:hyperlink.

PropTypeDescription
urlstringExternal URL
anchorstringInternal bookmark name
tooltipstringHover tooltip

<bookmark>​

Maps to w:bookmarkStart/End.

PropTypeDescription
namestringRequired. Bookmark name
idstringUnique identifier

Headers and footers​

PropTypeDescription
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>​

PropTypeDescription
authorstringComment author
datestringComment date
idstringComment ID

<footnote>​

Props: id (string). Content provided as children.

Fields​

<field>​

Maps to w:fldChar.

PropTypeDescription
codestringField code: "PAGE", "NUMPAGES", "DATE"
formatstringDisplay format

Breaks and whitespace​

ComponentOOXMLProps
<pagebreak>w:br type=page--
<linebreak>w:br--
<columnbreak>w:br type=column--
<tab>w:tab--
<tabstop>w:tabsposition, type, leader