Screenfull is a lightweight JavaScript library that simplifies use of the browser Fullscreen API across supported browsers. It lets developers place an entire page or an individual element into fullscreen mode through a consistent interface. The library smooths over browser-specific API differences that would otherwise require extra compatibility code. Applications can request fullscreen, exit it, toggle it, inspect the active fullscreen element, and check whether fullscreen is available. It also exposes fullscreen change and error events for reactive interfaces. Screenfull is distributed as an ESM package, is only about 0.7 kB when gzipped, and is considered feature complete. It does not support fullscreen operation on iPhone.
Features
- Cross-browser Fullscreen API wrapper
- Whole-page and individual-element fullscreen modes
- Fullscreen request, exit, and toggle controls
- Fullscreen availability and active-element detection
- Change and error event handling
- Minimal ESM package footprint