Docs Page
Provides a page layout wrapper with proper spacing, structure, and optional table of contents. Renders page headers from metadata and includes footer support for copyright and links.
Perfect for documentation pages that need consistent structure and automatic header generation from frontmatter or metadata.
Installation
shellUsage
tsxProps
Examples
With MDX Content
Docs Page works seamlessly with MDX:
tsxWith Footer
Include copyright and GitHub link:
tsxWith Header Actions
Add custom actions to the page header:
tsxCustom Header
Replace the default header with custom content:
tsxWithout Table of Contents
Omit the table of contents for simpler pages:
tsxAdjust Content Width and Padding
Customize spacing for different content types:
tsxCompact Layout
Create a tighter layout with reduced spacing:
tsxSpacious Layout
Create an airy layout with more breathing room:
tsxCustom Container Size
Control content width independently of padding:
tsxRequirements
For the table of contents to work properly:
- Content must include
data-content-areaattribute (automatically added by DocsPage) - Headings must have
idattributes (userehype-slugfor MDX) - TableOfContents component must be rendered client-side
Accessibility
Docs Page provides semantic structure for accessibility:
Semantic HTML
- Proper heading hierarchy with page title as h1
- Semantic sectioning elements for content areas
- Footer uses appropriate landmark roles
Screen Readers
- Page metadata announced clearly
- Content area properly labeled
- Footer copyright and links accessible
Responsive Design
- Mobile-first responsive layout
- Table of contents repositions on smaller screens
- Touch-friendly spacing and sizing
Changelog
Added
- Page layout wrapper component
- Automatic header generation from metadata
- Table of contents sidebar support
- Footer with copyright and GitHub link
- Custom header and header actions support
- Configurable content width and padding
- New:
containerSizeprop for controlling content area width - New:
contentGapprop for spacing between header and content - New:
outerMarginprop for vertical margin on outer container - New:
contentPaddingprop for responsive padding on main content area - Fixed:
maxWidthandpaddingprops now actually applied to the layout