screenfull

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

Library
npm
v6.0.2
7,138 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
59 /100 Fair
Development Activity 48
Maintenance 24
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
70 /100 Good
Architecture 68
Code Quality 62
Innovation 55
Learning Curve 95

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
73%
GPL 3.0

1Panel

Devops · Hosting Control Panel · Monitoring

37,044

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
Go 73%
Vue 27%
Updated 4 days ago
TypeScript
70%
Other

Budibase

Low Code Platforms · No Code Platforms

28,324

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

View details
91
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 70%
Svelte 26%
Updated 1 weeks ago
Java
70%
GPL 3.0

DataEase

AI Assistants · Analytics · Data Engineering

24,558

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
65
Dependency
Built with
Java 70%
Vue 29%
Updated 4 days ago
Python
51%
AGPL 3.0

LearnHouse

CMS · Learning Management

2,301

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

View details
90
Repo Health
77
Technical
66
Dependency
Built with
Python 51%
TypeScript 48%
Updated 5 days ago
Python
45%
GPL 3.0

MaxKB

AI Development · Knowledge Management

22,882

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

View details
92
Repo Health
68
Technical
66
Dependency
Built with
Python 45%
Vue 37%
TypeScript 17%
Updated 4 days ago
Ruby
79%
GPL 3.0

OpenProject

Collaboration · Productivity · Project Management

16,229

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
69
Dependency
Built with
Ruby 79%
TypeScript 13%
Updated 4 days ago
Python
57%
Other

Sentry

Analytics · Developer Tools · Monitoring

44,862

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
69
Dependency
Built with
Python 57%
TypeScript 41%
Updated 4 days ago

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