useFullscreen
manages DOM full screen.
Code demonstration
Image full screen
API
const [
isFullscreen,
{
enterFullscreen,
exitFullscreen,
toggleFullscreen,
isEnabled,
}] = useFullScreen(
target,
options?: Options
);
const [
isFullscreen,
{
enterFullscreen,
exitFullscreen,
toggleFullscreen,
isEnabled,
}] = useFullScreen(
target,
options?: Options
);
Params
Property | Description | Type |
---|---|---|
target | DOM element or ref | Element |
option | Setting | Options |
Options
Property | Description | Type | Default |
---|---|---|---|
onExit | Exit full screen trigger | () => void | - |
onEnter | Enter full screen trigger | () => void | - |
defaultElement | Default full screen element | Element | HTMLElement | html |
Result
Property | Description | Type |
---|---|---|
isFullscren | Is full screen | Readonly<Ref<boolean>> |
enterFullscreen | Enter full screen | () => void |
exitFullscreen | Exit full screen | () => void |
toggleFullscreen | Toggle full screen | () => void |
isEnabled | Is enable screenfull | boolean |