Skip to content

Installation

The meta package

bash
npm install dualscreen
# pnpm add dualscreen · yarn add dualscreen · bun add dualscreen

react is an optional peer dependency — needed only if you use the React bindings.

Entry points:

ImportContents
dualscreenFramework-agnostic core. No React dependency.
dualscreen/reactHooks and components.
dualscreen/screensDisplay detection and placement.
dualscreen/devtoolsDebug overlay. Dev-only.

Individual packages

If you want a smaller dependency graph, install only what you use:

bash
npm install @dualscreen/core          # 4.8 kB gzip, no framework
npm install @dualscreen/react         # + hooks and components
npm install @dualscreen/screens       # + display detection
npm install -D @dualscreen/devtools   # dev-only overlay

@dualscreen/react depends on core and screens, so installing it is enough.

Requirements

BrowsersAnything with BroadcastChannel — Chrome 54+, Firefox 38+, Safari 15.4+
React18 or 19, only if using the React bindings
TypeScriptTypes are bundled; no @types package needed
Secure contextHTTPS or localhost, required by Web Locks and Window Management

Everything degrades if an API is missing — see Browser support.

Bundle size

Packagemin+gzip
@dualscreen/core4.8 kB
@dualscreen/screens2.3 kB
@dualscreen/react2.9 kB
@dualscreen/devtools1.9 kB

Full React stack: ~10 kB gzipped, zero third-party runtime dependencies. All packages are ESM and CJS, side-effect free, and tree-shakeable.

Released under the MIT License.