Multi-Page Documents
Nebula supports two pagination styles you can combine.
1. Automatic overflow (dynamic content)
Section titled “1. Automatic overflow (dynamic content)”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>2. Manual pagination (explicit pages)
Section titled “2. Manual pagination (explicit pages)”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> </>,);What splits vs what moves
Section titled “What splits vs what moves”| 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 |
Atomic Box example
Section titled “Atomic Box example”<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>Mixing table + footer
Section titled “Mixing table + footer”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>Dig deeper
Section titled “Dig deeper”- Layout Engine — bin-packing details
- Pipeline — end-to-end flow