Skip to main content
Every viewer — whether embedded via new ScreenJSONUI(...), auto-mounted from a CDN script tag, or used as a Svelte component — supports the same option set.

ScreenJSONUIConfig

Theme

Theme resolution order at boot:
  1. config.theme
  2. localStorage['screenjson-theme']
  3. prefers-color-scheme
  4. 'light' (final fallback)

Lang

A BCP 47 language tag string — en, en-GB, fr-CA, ja, zh-Hant, sr-Latn-RS. The viewer’s language picker only appears when the document declares more than one.

Auto-fit zoom

The viewer measures its container width and shrinks the paper to fit when the viewport is narrower than the natural 8.5″ page. Your zoom config is a multiplier on top of that fit:
Toolbar zoom buttons adjust zoom in 10% steps.

CSS variables

Every visual token is a CSS custom property declared on :root (or on html.dark for the dark variant). Override any of them in your own stylesheet to re-theme:
The complete token list is in app.css.

Formatting constants

The viewer also exports formatting constants from screenjson-ui/dist/... if you want to reuse them in your own calculations: