usePrint
Getting started

Automatic setup

Scaffold a new Useprint project with init-doc.

For the fastest path to a working preview, use init-doc. It creates a folder with a starter document, pinned @useprint/components and @useprint/cli versions, and npm scripts ready to go.

Using a monorepo? See Monorepo setup (or Manual install for a flat repo).

1. Install

We recommend using init-doc, which sets up everything automatically.

npx init-doc@latest

This creates a new folder called useprint-starter with a sample document and project files.

To use a different folder name, pass it as the first argument:

npx init-doc@latest my-documents

To pin Useprint packages to a specific npm dist-tag (for example a prerelease), use --tag:

npx init-doc@latest --tag next

2. Run locally

Change into the project directory and install dependencies:

cd useprint-starter
npm install

Then start the development server:

npm run dev

3. See changes live

Open http://localhost:3000 and edit files under documents/ to see updates in the preview.

  • Add new .tsx files in documents/ with a default-exported React component.
  • Put static assets in documents/static/ when you need images, fonts, or other files the preview can load.

4. Next steps

On this page