Private betav0.1.0
Docs
Format developer documentation

PageBreak

A marker forcing a page boundary, regardless of fit.

A PageBreak is an instruction to start the following content on a fresh page. It applies regardless of whether the current page still had room.

Format honors it under every pagination strategy, including manual, which otherwise ignores overflow but still respects authored breaks.

Fields

No fields.

Example

A PageBreak sits among the items that stream in a Flow. Format ends the current page at the marker and places the next item on a fresh page, so Widget B opens a new page whether or not Widget A overflowed.

export const doc = () => (
  <Document title="Invoice #1234">
    <Layout id="invoice" width={793.71} height={1122.52}>
      <Flow>
        <table>
          <tbody>
            <Stream>
              <tr><td>Widget A</td></tr>

              <PageBreak />

              <tr><td>Widget B</td></tr>
            </Stream>
          </tbody>
        </table>
      </Flow>
    </Layout>
  </Document>
)
<template>
  <Document title="Invoice #1234">
    <Layout id="invoice" :width="793.71" :height="1122.52">
      <Flow>
        <table>
          <tbody>
            <Stream>
              <tr><td>Widget A</td></tr>

              <PageBreak />

              <tr><td>Widget B</td></tr>
            </Stream>
          </tbody>
        </table>
      </Flow>
    </Layout>
  </Document>
</template>
<template data-type="document" data-title="Invoice #1234">
  <template data-type="layout" data-id="invoice" data-width="793.71px" data-height="1122.52px">
    <template data-type="flow">
      <table>
        <tbody>
          <template data-type="stream">
            <tr><td>Widget A</td></tr>

            <template data-type="page-break"></template>

            <tr><td>Widget B</td></tr>
          </template>
        </tbody>
      </table>
    </template>
  </template>
</template>

Usage

Use a PageBreak when the page boundary matters more than how content fits: when this content should start fresh whether or not the previous page had room. Common cases:

  • Dividers inside a long body. Place one at a chapter start, at a year boundary in a multi-year report, or before an end-of-quarter summary.
  • Pinning standalone content to its own page. Put one before a full-width chart so it never sits jammed at the bottom of a previous page.
  • Forcing structure under manual pagination. When you have opted out of overflow breaks, a PageBreak is the only signal that starts a new page.

For content that might overflow and should spill onto a new page only when it runs long, prefer auto pagination over a PageBreak. Reserve the marker for breaks you intend.

Constraints

  • Honored under every pagination strategy. Both auto and manual break the page at the marker.
  • Must be a direct item of a Flow's stream. A bare Flow takes it as a direct child of the Flow. A scaffolded Flow takes it as a direct child of its Stream. A PageBreak buried in other content, such as inside an <ol> or a table cell, renders nothing and reports a misplaced-marker diagnostic on DocumentSummary.elements.misplacedMarkers.
  • The marker carries no state. Its presence is the entire signal.
Was this page helpful?