# @react-pdf/layout

> Resolve document component's layout

Latest version **5.2.0** (published 2026-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @react-pdf/layout
pnpm add @react-pdf/layout
yarn add @react-pdf/layout
bun add @react-pdf/layout
```

## Health

**Score 80/100 (A)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.2.0 |
| Published | 2026-08-27 |
| First published | 2020-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 163.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 16815 |
| Author | Diego Muracciole |
| Maintainers | diegomura |

## Links

- npm: https://www.npmjs.com/package/@react-pdf/layout
- Repository: https://github.com/diegomura/react-pdf
- Homepage: https://github.com/diegomura/react-pdf#readme
- Issues: https://github.com/diegomura/react-pdf/issues
- npm.io page: https://npm.io/package/@react-pdf/layout

## Dependencies (10)

- [queue](https://npm.io/package/queue.md) ^6.0.1
- [yoga-layout](https://npm.io/package/yoga-layout.md) ^3.2.1
- [@react-pdf/fns](https://npm.io/package/@react-pdf/fns.md) 3.1.3
- [emoji-regex-xs](https://npm.io/package/emoji-regex-xs.md) ^1.0.0
- [@react-pdf/image](https://npm.io/package/@react-pdf/image.md) ^3.1.2
- [@react-pdf/types](https://npm.io/package/@react-pdf/types.md) ^2.14.0
- [@react-pdf/textkit](https://npm.io/package/@react-pdf/textkit.md) ^7.0.1
- [@react-pdf/paginate](https://npm.io/package/@react-pdf/paginate.md) 1.0.1
- [@react-pdf/primitives](https://npm.io/package/@react-pdf/primitives.md) ^4.4.0
- [@react-pdf/stylesheet](https://npm.io/package/@react-pdf/stylesheet.md) ^6.3.2

## Recent versions

- 5.2.0 (latest) — 2026-08-27
- 2.0.0-beta.20 (beta) — 2021-04-05
- 5.1.1 — 2026-08-24
- 5.1.0 — 2026-08-23
- 5.0.0 — 2026-08-23
- 4.7.1 — 2026-08-14
- 4.7.0 — 2026-08-08
- 4.6.1 — 2026-04-15
- 4.6.0 — 2026-04-15
- 4.5.1 — 2026-04-10
- 4.5.0 — 2026-04-06
- 4.4.3 — 2026-04-04
- 4.4.2 — 2025-12-29
- 4.4.1 — 2025-09-23
- 4.4.0 — 2025-03-05
- … 81 more at https://npm.io/package/@react-pdf/layout/versions

## README

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @react-pdf/layout

Layout engine for react-pdf. Takes the document element tree produced by the reconciler and resolves it into an absolutely positioned page tree: it parses styles, measures text with textkit, computes flexbox layout with Yoga, resolves images and SVG, and paginates content into fixed-size pages ready for rendering.

## Installation

```bash
yarn add @react-pdf/layout
```

## Usage

```js
import layout from '@react-pdf/layout';

const layoutTree = await layout(documentTree, fontStore);
```

The default export is an async function that composes the individual resolution steps (styles, inheritance, page sizes, Yoga layout, text layout, pagination, and so on) over a document root node and returns the fully resolved tree consumed by `@react-pdf/render`.

## License

MIT

---
_Source: https://npm.io/package/@react-pdf/layout · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
