diff --git a/examples/basic/README.md b/examples/basic/README.md new file mode 100644 index 0000000..03679b2 --- /dev/null +++ b/examples/basic/README.md @@ -0,0 +1,30 @@ +# @polyrender/example-basic + +Vite + vanilla TypeScript example for [`@polyrender/core`](../../packages/core/README.md). Demonstrates file-picker based document viewing with the built-in toolbar. + +A live demo is coming soon. + +## Running locally + +```bash +# From the monorepo root, build all packages first: +pnpm build + +# Then start the Vite dev server: +cd examples/basic +pnpm dev +``` + +To build for production: + +```bash +pnpm build +pnpm preview +``` + +## What it shows + +- Opening a local file via a file input +- Auto-detecting the document format from the filename +- Rendering with the built-in dark-themed toolbar +- Configuring the `pdfjs-dist` worker URL via Vite's `?url` import diff --git a/examples/react/README.md b/examples/react/README.md new file mode 100644 index 0000000..13c5d51 --- /dev/null +++ b/examples/react/README.md @@ -0,0 +1,23 @@ +# @polyrender/example-react + +Vite + React example for [`@polyrender/react`](../../packages/react/README.md). Demonstrates the `` component and the `useDocumentRenderer` headless hook. + +> **Note:** This example is still a work in progress. A live demo is coming soon. + +## Running locally + +```bash +# From the monorepo root, build all packages first: +pnpm build + +# Then start the Vite dev server: +cd examples/react +pnpm dev +``` + +To build for production: + +```bash +pnpm build +pnpm preview +``` diff --git a/examples/vanilla/README.md b/examples/vanilla/README.md new file mode 100644 index 0000000..afe45bd --- /dev/null +++ b/examples/vanilla/README.md @@ -0,0 +1,22 @@ +# @polyrender/example-vanilla + +Vanilla TypeScript example for [`@polyrender/core`](../../packages/core/README.md), built with esbuild. + +A hosted version of this example is available at **https://polyrender.wisp.place/**. + +## Running locally + +```bash +# From the monorepo root, build all packages first: +pnpm build + +# Then serve the example: +cd examples/vanilla +pnpm serve +``` + +Or use watch mode during development: + +```bash +pnpm dev +```