---
title: "Documentation — quario"
description: "Product reference for quario. A report is a definition: JSON you store, version and review, rendered to HTML, PDF, an XLSX workbook, or Word."
url: "https://getquario.com/docs"
---

# Documentation

quario treats a report as a **definition** — JSON you store, version and review —
rather than as generated code. The same definition renders to four document
shapes: a page, a PDF, a workbook, and a Word document.

## Safe by construction

Expressions in a definition parse into closures. There is no `eval`, no
`new Function`, and no code generation anywhere in the render path. That’s a
property of how the engine reads a definition, not a sandbox bolted on
afterwards. [Trust and CSP](https://getquario.com/docs/diving-deeper/security.md) sets out what the engine
treats as trusted and what it doesn’t.

## One definition, four shapes

| Package | Renders |
| --- | --- |
| `@quario/html` | A page, styled from the definition’s own vocabulary |
| `@quario/pdf` | A PDF, with no headless browser in the pipeline |
| `@quario/xlsx` | A workbook, where numbers stay numbers |
| `@quario/docx` | A Word document, with real tables, and a navigation outline |

Install the engine with `npm install quario` and add the targets you render to.
`@quario/csv` is a fifth target: a data export rather than a document shape, so
it’s outside this list.

### Painters, flow targets, and a fragment

Targets differ in who decides where the pages break, and it’s worth knowing
which kind you render to before you declare page furniture.

A **painter** lays the document out itself. `@quario/pdf` paginates, reserves
the height its page bands need, and can therefore promise where every line
falls.

A **flow target** states the geometry and the typography and lets the reader’s
application paginate. `@quario/docx` runs no layout of its own, so the promise
is the same look rather than the same page breaks. Page bands become a Word
section’s header and footer, and a bare `{{ page.number }}` becomes a live
field Word recomputes.

A **fragment** has no pages at all. `@quario/html` returns markup for a page
you already own and leaves page bands unread. It turns a group’s `break` into a
class your print CSS may act on.

`@quario/csv` answers to none of these: a record has no page at all, so page
declarations withdraw. `@quario/xlsx` is a grid rather than a page, but a reader
still prints a worksheet. A group’s `break` opens a sheet there, and
`xlsx({ page })` configures the paper.

## Start here

[Getting started](https://getquario.com/docs/getting-started.md) is the one to read first. It builds an
invoice from a record your application already has, renders it into a page, and
renders the same definition as a PDF.

Once that holds, the Diving Deeper pages go one level down, each on one thing.

**Writing a definition**

- [Supplying the data](https://getquario.com/docs/diving-deeper/supplying-data.md) — where the payload comes from, and what the engine never does.
- [Scopes](https://getquario.com/docs/diving-deeper/scopes.md) — what an expression can read, and where.
- [Selecting rows](https://getquario.com/docs/diving-deeper/selecting-rows.md) — choosing, filtering, ordering, and ranking the rows.
- [Bands](https://getquario.com/docs/diving-deeper/bands.md) — the report header, groups, detail, page furniture, and columns.
- [Totals](https://getquario.com/docs/diving-deeper/totals.md) — aggregates, running values, and inline reducers.
- [Formatting](https://getquario.com/docs/diving-deeper/formatting.md) — presenting numbers and dates without turning them into strings.
- [Styling](https://getquario.com/docs/diving-deeper/styling.md) — the closed vocabulary, how it layers, and the box.
- [Images and splits](https://getquario.com/docs/diving-deeper/images-and-splits.md) — placing a picture, and laying cells across the width.
- [Host functions](https://getquario.com/docs/diving-deeper/host-functions.md) — the presentation policy the engine leaves to you.

**Rendering it**

- [The HTML target](https://getquario.com/docs/diving-deeper/html-target.md) — the fragment, the classes, and the stylesheet.
- [The PDF target](https://getquario.com/docs/diving-deeper/pdf-target.md) — page geometry, fonts, page breaks, and deterministic bytes.
- [The XLSX target](https://getquario.com/docs/diving-deeper/xlsx-target.md) — typed cells, a frozen header, and what a grid withdraws.
- [The CSV target](https://getquario.com/docs/diving-deeper/csv-target.md) — records, and the guard that changes your text.
- [The DOCX target](https://getquario.com/docs/diving-deeper/docx-target.md) — a flow target, real Word tables, and live page fields.
- [Custom targets](https://getquario.com/docs/diving-deeper/custom-target.md) — building your own renderer on the event stream.

**Embedding it**

- [The viewer](https://getquario.com/docs/diving-deeper/viewer.md) — pages on screen, and the export menu.
- [The editor](https://getquario.com/docs/diving-deeper/editor.md) — your users authoring their own definitions.

**Running it**

- [Validating definitions](https://getquario.com/docs/diving-deeper/validating.md) — compiling one in CI, and holding it in a service.
- [Trust and CSP](https://getquario.com/docs/diving-deeper/security.md) — the trust boundary, and rendering without `unsafe-eval`.
- [Licensing](https://getquario.com/docs/diving-deeper/licensing.md) — offline verification, and what an unlicensed render shows.
- [quario over MCP](https://getquario.com/docs/diving-deeper/mcp.md) — an agent’s tools, and the host it can’t reach.

The reference covers the engine and each package, for a signature rather than
an explanation.

- [quario](https://getquario.com/docs/reference/quario.md) — the instance, the compiled report, the target contract.
- [ReportSchema](https://getquario.com/docs/reference/report-schema.md) — every field a definition may hold.
- [Style declarations](https://getquario.com/docs/reference/style-declarations.md) — the closed style vocabulary.
- [Functions and reducers](https://getquario.com/docs/reference/functions-and-reducers.md) — what an expression may call.
- [Event stream](https://getquario.com/docs/reference/events.md) — the seam a custom target consumes.
- Targets: [@quario/html](https://getquario.com/docs/reference/html.md), [@quario/pdf](https://getquario.com/docs/reference/pdf.md), [@quario/xlsx](https://getquario.com/docs/reference/xlsx.md), [@quario/csv](https://getquario.com/docs/reference/csv.md), [@quario/docx](https://getquario.com/docs/reference/docx.md).
- Surfaces: [@quario/viewer](https://getquario.com/docs/reference/viewer.md), [@quario/editor](https://getquario.com/docs/reference/editor.md), [@quario/layout](https://getquario.com/docs/reference/layout.md).
- Agents: [@quario/mcp](https://getquario.com/docs/reference/mcp.md), the MCP server.
- [Support matrix](https://getquario.com/docs/reference/support-matrix.md) — what each target makes of a declaration, one table per concern.

For task-shaped walkthroughs rather than reference, see the
[guides](https://getquario.com/guides.md). For definitions you can copy whole, see the
[templates](https://getquario.com/templates.md).

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://getquario.com/"},{"@type":"ListItem","position":2,"name":"Docs","item":"https://getquario.com/docs"}]}
```
