useFullscreen

Put an element, or the whole page, in fullscreen.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

Without a ref the whole page goes fullscreen.

APIs

useFullscreen

const useFullscreen = <T extends HTMLElement = HTMLElement>() => {
  ref: RefObject<T | null>
  fullscreen: boolean
  enter: () => Promise<void>
  exit: () => Promise<void>
  toggle: () => Promise<void>
}
Edit this page on GitHub