Props
Basic usage
Custom title
Heading levels
Control how deep the TOC goes:Page numbers
Hyperlinks
Styling
Style the title:Full example
How it works
- Scans document for H1-H6 headings
- Filters by
levelsprop - Generates entries with indentation based on heading level
- Adds page numbers via Word’s PAGEREF field
- Creates hyperlinks to heading bookmarks
id props needed for TOC.
Updating the TOC
The TOC uses Word’s native field. To update page numbers after editing:- In Word: Right-click TOC → “Update Field”
- Or: Ctrl+A, then F9
