Composition
Build complex documents from smaller, reusable pieces. A component is a self-contained block of styles and content that any document — or other component — can drop in with use.
use is the same verb you already know from the canvas: a named component reference, optionally scoped with data and styled with style. Flow composition adds document concerns (config merge precedence); canvas composition adds geometry. One concept, two surfaces.
Why compose?
- Reuse — define a header, a cover page, or an appendix once;
useit from every template - Separate concerns — a designer owns the letterhead component, an analyst owns the body
- Iterate safely — update a component and every document that uses it picks up the change
Where use resolves
use works anywhere content elements appear — the top-level content array, columns, table cells, list items, and header/footer content.
In this section
- Components — declare a reusable component with the
"component"root key - Reusability — reference components with
use, scope data, cascade styles, and merge configuration - Sections & Watermarks — assemble multi-section documents with per-section frames and watermarks
- Nesting & Pipeline — recursion limits, safety guarantees, and how composition resolves