useFullscreen
manages DOM full screen.
Overview
manages DOM full screen.
Installation
Open inpnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useFullscreen.jsonnpx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useFullscreen.jsonyarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useFullscreen.jsonbun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useFullscreen.jsonmanages DOM full screen.
Examples
Default usage
Image full screen
Page full screen
Coexist with other full screen operations
API
const [isFullscreen, {
enterFullscreen,
exitFullscreen,
toggleFullscreen,
isEnabled,
}] = useFullScreen(
target,
options?: Options
);Params
| Property | Description | Type | Default |
| -- | | -- | | - |
| onExit | Exit full screen trigger | () => void | - |
| onEnter | Enter full screen trigger | () => void | - |
| pageFullscreen | Whether to enable full screen of page. If its type is object, it can set className and z-index of the full screen element | boolean | { className?: string, zIndex?: number } | false |
Result
| Property | Description | Type |
| --- |
| isFullscreen | Is full screen | boolean |
| enterFullscreen | Enter full screen | () => void |
| exitFullscreen | Exit full screen | () => void |
| toggleFullscreen | Toggle full screen | () => void |
| isEnabled | Is enable screenfull | boolean |
useFocusWithin
Monitor whether the current focus is within a certain area, Same as css attribute [:focus-within](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-within).
useFusionTable
useFusionTable encapsulates the commonly used [Fusion Form](https://fusion.design/pc/component/basic/form) and [Fusion Table](https://fusion.design/pc/component/basic/table) data binding logic.