New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@react-pdf/layout

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-pdf/layout

Resolve document component's layout

latest
Source
npmnpm
Version
5.2.0
Version published
Weekly downloads
9.3M
4.23%
Maintainers
1
Weekly downloads
 
Created
Source

@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

yarn add @react-pdf/layout

Usage

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

FAQs

Package last updated on 27 Aug 2026

Related posts