Skip to content

Multi-Page Documents

Nebula supports two pagination styles you can combine.

If a single <Page> contains more than fits, the layout engine splits it. Ideal for long text, tables, and dynamic lists.

<Page padding={40}>
<Text>This very long text will span multiple pages automatically...</Text>
</Page>

For distinct sections (cover + body), pass multiple <Page> components:

await engine.generate(
<>
<Page size="A4">
<Text>Cover Page</Text>
</Page>
<Page size="A4">
<Text>Second Page with different content...</Text>
</Page>
</>,
);
Component Behavior
<Text> Splittable — word-boundary split across pages
<Box>, <Image> Atomic — whole node moves to the next page
<Table> rows Atomic rows — specialized pagination; headers can repeat
<Page padding={40}>
<Text>Intro paragraph that can split…</Text>
<Box style={{ padding: 16, borderWidth: 1, borderColor: '#ccc', borderStyle: 'solid' }}>
<Text>This whole card moves together if it does not fit.</Text>
</Box>
</Page>

Content after a table can share the last table segment’s page:

<Page padding={40}>
<Table columns={columns} data={rows} options={{ headerRepeat: true }} />
<Text style={{ marginTop: 16, fontSize: 10 }}>End of statement.</Text>
</Page>