Hooks

useFullscreen

Publisher

cermuel

50 hooks published

More from this publisher

useFullscreen

Control and track fullscreen mode.

useFullscreen.tsx
import { useFullscreen } from "@cermuel/hooks/react";export function useFullscreenExample() {  const fullscreen = useFullscreen();  return <button type="button" onClick={fullscreen.toggle}>Toggle fullscreen</button>;}

Props

Param
Type
Default Value
target?
MaybeTarget<Element>

Returns

{ supported: boolean; element: Element | null; active: boolean; enter: () => Promise<void>; exit: () => Promise<void>; toggle: () => Promise<void>; }