Skip to content

useFullscreen ​

Category
Browser

Hook to handle fullscreen events

typescript
import { useFullscreen } from '@siberiacancode/reactuse';

Usage ​

typescript
const { enter, exit, toggle, value } = useFullscreen(ref);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
targetTarget-The target element for fullscreen
options.initialValue?booleanfalseinitial value of fullscreen
options.onEnter?() => void-on enter fullscreen
options.onExit?() => void-on exit fullscreen

Parameters

NameTypeDefaultNote
options.initialValue?booleanfalseinitial value of fullscreen
options.onEnter?() => void-on enter fullscreen
options.onExit?() => void-on exit fullscreen

Contributors ​

Source • Demo