usePrint
Getting started

Manual install

Install the default Useprint authoring and preview stack.

For a new project from scratch, Automatic setup with npx init-doc@latest is usually the quickest path.

For most existing projects, the best way to start is the combo of @useprint/components for authoring and @useprint/cli for local preview.

For npm / pnpm / Yarn workspaces, use the dedicated Monorepo setup guide so preview runs from the correct package.

Install

npm install @useprint/components react react-dom
npm install -D @useprint/cli @types/react @types/react-dom typescript

This gives you:

  • React document primitives such as Document, Head, Body, and Page
  • Access to rendering and Tailwind helpers through the component package
  • A local preview and export workflow through the useprint CLI
  • TypeScript and React type packages for .tsx documents

Add a documents directory

By default, the CLI looks for documents in ./documents.

documents/
  invoice.tsx
  static/
  • Put your document components directly in documents/
  • Put images, fonts, and other static assets in documents/static/

Next steps

On this page