Skip to content

useFullscreen ​

browser
test coverage
Last changed: 24 days ago

Hook to handle fullscreen events

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

Usage ​

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

Demo ​

Api ​

Parameters

NameTypeDefaultNote
targetHookTarget-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

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarhywax

Released under the MIT License.