Skip to content

Function: onFullscreenChange() ​

ts
function onFullscreenChange(callback): () => void;

Registers a callback that fires whenever the document enters or exits fullscreen mode.

Parameters ​

ParameterTypeDescription
callback(isFull) => voidCalled with true when entering fullscreen, false when exiting.

Returns ​

A cleanup function that removes the listener.

() => void

Example ​

ts
const off = onFullscreenChange((isFull) => console.log(isFull))
off() // remove listener

Since ​

1.0.0

Released under the MIT License.