screenfull

A simple wrapper for cross-browser usage of the JavaScript Fullscreen API

Library
npm
v6.0.2
7,140stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
46/100Fair
Development Activity0
Maintenance20
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
70/100Good
Architecture68
Code Quality62
Innovation55
Learning Curve95

screenfull is a tiny (0.7 kB gzipped) wrapper around the browser Fullscreen API that smooths over vendor-prefix differences (requestFullscreen vs mozRequestFullScreen vs webkitRequestFullScreen) so developers can call one consistent API instead of feature-detecting and branching across browser implementations themselves.

Written by Sindre Sorhus, it exposes a single default export with request(), exit(), toggle(), an isFullscreen getter, and a change/error event API, and works on both the whole document and an individual DOM element. The library is explicitly declared feature-complete by its maintainer — it does exactly one thing and isn’t expected to grow further.

What You Get

  • screenfull.request(element?) to enter fullscreen for the whole page or a specific element
  • screenfull.exit() and screenfull.toggle() for leaving or toggling fullscreen state
  • screenfull.isFullscreen and screenfull.isEnabled getters for checking current/available fullscreen state
  • A change event fired whenever fullscreen state changes, and an error event for failed fullscreen requests
  • Full TypeScript type definitions bundled with the package
  • A tiny (0.7 kB gzipped) footprint with zero runtime dependencies

Common Use Cases

  • Adding a ‘fullscreen’ button to video players, image galleries, or presentation/kiosk-mode web apps
  • Building custom video players that need reliable fullscreen toggling across Chrome, Firefox, and Safari
  • Kiosk or dashboard applications that need to enter fullscreen mode on a specific element rather than the whole page
  • Any app avoiding hand-rolled vendor-prefix branching for the native Fullscreen API

Under The Hood

Architecture — The entire implementation lives in a single index.js file (160 lines): an internal function map resolves the correct vendor-prefixed method/property names once at module load (checking document.fullscreenEnabled, mozFullScreenEnabled, webkitFullscreenEnabled in order), then the exported screenfull object’s methods (request, exit, toggle) simply delegate to whichever underlying browser method was detected, normalizing return values as Promises regardless of whether the native API is Promise-based or callback-based.

Tech Stack — Zero runtime dependencies, pure vanilla JavaScript, published as an ESM-only package (a deliberate v6 migration point called out prominently in the README, with v5.2.0 recommended for consumers who cannot use ESM or need older browser support without transpilation). TypeScript definitions are hand-authored and shipped alongside the JS.

Code Quality — Testing is limited to xo (opinionated ESLint config) for linting and tsd for validating the TypeScript type definitions against index.test-d.ts — there is no runtime unit test suite, which is a reasonable trade-off given the library’s entire surface area is thin delegation to browser-native APIs that can’t meaningfully be unit-tested outside a real browser. The maintainer has explicitly marked the library feature-complete, so the low recent commit activity reflects stability rather than abandonment.

API Design — The single default-export object with request/exit/toggle/isFullscreen is about as minimal as a wrapper API can get, deliberately mirroring the shape of the native Fullscreen API rather than inventing new abstractions. This makes the learning curve close to zero for anyone who has read one MDN page on fullscreen, while still eliminating the actual pain point (vendor-prefix branching) that motivates using a wrapper at all.

Used by 7 apps in this directory

Go
72%
GPL 3.0

1Panel

Devops · Hosting Control Panel · Monitoring

36,573

The only open-source VPS control panel with native AI agent runtime — deploy websites, Docker stacks, and local LLMs from one web interface.

View details
91
Repo Health
76
Technical
67
Dependency
Built with
Go72%
Vue28%
Updated today
TypeScript
69%
Other

Budibase

Low Code Platforms · No Code Platforms

28,220

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
92
Repo Health
81
Technical
63
Dependency
Built with
TypeScript69%
Svelte26%
Updated today
Java
78%
GPL 3.0

DataEase

Analytics · Data Engineering · AI Assistants

24,346

Open-source BI tool with drag-and-drop dashboards, 20+ data source connectors, and AI-powered natural language queries — a self-hosted alternative to Tableau.

View details
94
Repo Health
71
Technical
66
Dependency
Built with
Java78%
Vue22%
Updated today
Python
51%
AGPL 3.0

LearnHouse

Learning Management · CMS

2,178

Open-source LMS with AI tutoring, real-time collaboration boards, live code execution, and built-in course monetization — self-hosted in minutes.

View details
89
Repo Health
77
Technical
67
Dependency
Built with
Python51%
TypeScript48%
Updated 3 days ago
Python
45%
GPL 3.0

MaxKB

AI Development · Knowledge Management

22,539

Build enterprise-grade AI agents with RAG, workflows & multi-modal support

View details
91
Repo Health
68
Technical
66
Dependency
Built with
Python45%
Vue37%
TypeScript17%
Updated today
Ruby
79%
GPL 3.0

OpenProject

Project Management · Productivity · Collaboration

15,881

The open source project management platform that unifies Gantt charts, agile boards, time tracking, and team collaboration under full self-hosted control.

View details
96
Repo Health
79
Technical
70
Dependency
Built with
Ruby79%
TypeScript13%
Updated today
Python
58%
Other

Sentry

Security · Developer Tools · Monitoring

44,574

Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.

View details
95
Repo Health
80
Technical
70
Dependency
Built with
Python58%
TypeScript41%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search