Private betav0.3.0
DocsSign in
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" lang="en">
    <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" lang="en">
    <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" data-lang="en">
  <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.
  • Place it directly in the stream. Use a direct child of a bare Flow, or of the Stream in a scaffolded Flow. A PageBreak inside other content, such as an <ol> or a table cell, has no effect.
  • The marker carries no state. Its presence is the entire signal.
Was this page helpful?