MarginBox
Position content in page margins for print layouts
The MarginBox
component allows you to position content in the margins of printed pages. It’s particularly useful for adding headers, watermarks, and other content that needs to appear in the margin areas of your printed documents.
For page numbers and footers, we recommend using the Footer component which provides built-in page numbering functionality.
Usage
The MarginBox
component uses CSS Paged Media specifications to position content in specific margin boxes around your page.
Props
Specifies where the content should appear in the page margins. See Position Options below for valid values.
A unique identifier for this margin box content. Must be unique across your document.
The content to display in the margin box.
Controls which pages the margin box appears on:
'all'
: Appears on all pages'even'
: Only appears on even-numbered pages'odd'
: Only appears on odd-numbered pages'blank'
: Only appears on blank pages
Additional CSS classes to apply to the margin box.
Custom React CSS styles for the margin box content.
CSS styles specifically for the margin box container.
Position Options
The position
prop accepts the following values: