Hooks
useWheelNav
Converts mouse wheel events into debounced section navigation for deck-style presentations.
Usage
useWheelNav({
containerRef,
goTo,
currentIndexRef,
})Installation
npx visor add use-wheel-navParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
containerRef | React.RefObject<HTMLElement | null> | No | -- | Container element to listen on. Falls back to document if not provided. |
goTo | (index: number) => void | Yes | -- | Navigation function that scrolls to the given section index. |
currentIndexRef | React.MutableRefObject<number> | Yes | -- | Mutable ref holding the current section index. |
Returns
This hook does not return a value.