npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@screenjson/ui

v1.0.1

Published

An embeddable document viewer for ScreenJSON screenplay files — renders Final Draft-style pages in the browser.

Downloads

191

Readme

@screenjson/ui

An embeddable, framework-agnostic JavaScript viewer for ScreenJSON documents. Renders screenplays as Final Draft / WriterDuet-style print pages in the browser, with light + dark themes, multi-language support, and in-browser AES-256 decryption.

Light mode

Dark mode

npm install @screenjson/ui

Features

  • Print-screenplay layout — US Letter, Courier Prime 12pt, industry margins.
  • Light + dark themes, with system-preference detection and localStorage persistence.
  • Multi-language documents — switch render language at runtime.
  • Auto-fit zoom — paper shrinks to viewport on narrow screens; manual zoom on top.
  • Built-in toolbar with theme, zoom, language, info, print, and download.
  • Tailwind v4 + native CSS variables — easy to re-theme.
  • Zero framework dependency in the embed API; native Svelte component for SvelteKit users.

Quick start

npm

import ScreenJSONUI from '@screenjson/ui';
import '@screenjson/ui/style.css';

const viewer = new ScreenJSONUI({
  element: 'viewer',           // an id or HTMLElement
  src:     '/screenplay.json', // URL — or use `document` for a pre-loaded object
  theme:   'dark'              // 'light' | 'dark', defaults to system preference
});

CDN — single script tag

<div id="viewer" style="height: 100vh;"></div>

<link rel="stylesheet" href="https://unpkg.com/@screenjson/ui/dist/ui.css" />
<script type="module">
  import ScreenJSONUI from 'https://unpkg.com/@screenjson/ui/dist/screenjson-ui.js';

  new ScreenJSONUI({ element: 'viewer', src: '/screenplay.json' });
</script>

CDN — data attributes (no JS needed)

<div id="viewer" style="height: 100vh;"></div>

<link rel="stylesheet" href="https://unpkg.com/@screenjson/ui/dist/ui.css" />
<script
  src="https://unpkg.com/@screenjson/ui/dist/screenjson-ui.js"
  data-src="/screenplay.json"
  data-theme="dark">
</script>

Svelte / SvelteKit

<script lang="ts">
  import { ScreenJSONViewer } from '@screenjson/ui';
  import '@screenjson/ui/style.css';
  import type { ScreenJSONDocument } from '@screenjson/ui';

  export let document: ScreenJSONDocument;
</script>

<ScreenJSONViewer {document} theme="light" />

Configuration

All configuration goes through ScreenJSONUIConfig:

| Option | Type | Default | Description | |---|---|---|---| | element | string \| HTMLElement | required | Mount target. String is treated as an element id. | | src | string | — | URL of a ScreenJSON document. | | document | ScreenJSONDocument | — | Pre-loaded document — overrides src. | | theme | 'light' \| 'dark' | system preference | Initial theme. | | zoom | number | 1 | Manual zoom multiplier on top of auto-fit. 0.5 – 2. | | lang | string | document lang | BCP 47 tag — chooses which language to render. | | numbered | boolean | false | Show scene numbers in the margin. | | paginated | boolean | true | Show page numbers. | | password | string | — | Password for AES-256 encrypted documents. | | onLoad | (doc) => void | — | Called once after the document loads. | | onPageChange | (page) => void | — | Called on every page change. | | onError | (err) => void | — | Called on fetch / parse / decrypt errors. |

Development

git clone https://github.com/screenjson/screenjson-ui.git
cd screenjson-ui
npm install
npm run dev          # SvelteKit dev server on http://127.0.0.1:5173
npm run build:lib

The standalone dev server at / includes a sidebar with bundled example screenplays, a file uploader, and a URL loader for any remote ScreenJSON document.

Browser support

Chrome 90+, Firefox 90+, Safari 14+, Edge 90+. Uses CSS zoom for paper scaling — works in all four. Print uses the standard @page { size: letter; }.

The published ESM entry (src/lib/index.ts) avoids export * in the public barrel (Safari / WKWebView can reject import … from '@screenjson/ui' when default and star re-exports share that module). Re-exports are explicit lists from ./embed, ./components/elements, ./services/bookmarks, and ./constants/formatting.

License

MIT — © AC DEV SERVICES, LLC.

The ScreenJSON schema is also open: see the specification.