explaingit

sindresorhus/screenfull

Analysis updated 2026-06-24

7,148HTMLAudience · developerComplexity · 1/5Setup · easy

TLDR

A tiny JavaScript library (under 1 KB) that gives browsers a single, consistent API for going fullscreen, hiding the differences between Chrome, Firefox, and Safari's implementations.

Mindmap

mindmap
  root((repo))
    What it does
      Cross-browser fullscreen
      Single consistent API
      Event listening
    Tech stack
      JavaScript
      Browser APIs
    Use cases
      Video players
      Games and slideshows
      Photo viewers
    Audience
      Web developers
      Framework users
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a fullscreen button to a video player that works across Chrome, Firefox, and Safari without browser-specific code.

USE CASE 2

Make a web-based game or slideshow presentation go fullscreen with a single function call.

USE CASE 3

Detect when a user exits fullscreen mode so your app can respond, such as pausing a video.

USE CASE 4

Target a specific element like an image or a map to go fullscreen instead of the whole page.

What is it built with?

JavaScript

How does it compare?

sindresorhus/screenfulldixonandmoe/rellaxblackrockdigital/startbootstrap
Stars7,1487,1477,161
LanguageHTMLHTMLHTML
Setup difficultyeasyeasyeasy
Complexity1/51/51/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

In plain English

Screenfull is a tiny JavaScript library, under 1 kilobyte, that makes it straightforward to take a webpage or any element on it into full-screen mode in a browser. Browsers have a built-in fullscreen feature, but the code needed to trigger it varies across Chrome, Firefox, and Safari because each one historically used slightly different names for the same functions. Screenfull hides all of that behind a single consistent API. With it, going fullscreen is a two-line call: check whether it is allowed, then request it. You can target the whole page or a specific element, like a video or an image. You can also listen for events to know when the user enters or exits fullscreen, or detect errors if the request is blocked. The library works on desktop Chrome, Firefox, and Safari, as well as on iPad. It does not work on iPhone, which is a browser limitation rather than a library one. The maintainer has marked the project feature complete, meaning it does what it does and no new capabilities will be added. Screenfull is a good fit for any web project that needs fullscreen behavior, such as video players, photo viewers, games, or presentation tools. It is installed via npm and works with plain JavaScript, jQuery, Angular, and other frameworks.

Copy-paste prompts

Prompt 1
How do I use screenfull.js to make a video element go fullscreen when a button is clicked, and handle the case where fullscreen is not supported?
Prompt 2
Show me how to listen for fullscreen change and error events using the screenfull library in a vanilla JavaScript web app.
Prompt 3
How can I use screenfull to make only a specific div element go fullscreen instead of the whole browser window?
Prompt 4
What is the correct way to check if fullscreen mode is available in the current browser before calling screenfull.request()?

Frequently asked questions

What is screenfull?

A tiny JavaScript library (under 1 KB) that gives browsers a single, consistent API for going fullscreen, hiding the differences between Chrome, Firefox, and Safari's implementations.

What language is screenfull written in?

Mainly HTML. The stack also includes JavaScript.

How hard is screenfull to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is screenfull for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.