Documentation Index
Fetch the complete documentation index at: https://mintlify.com/willnguyen1312/zoom-image/llms.txt
Use this file to discover all available pages before exploring further.
Hook Signature
Return Value
The hook returns an object with the following properties:Reactive state object that updates when zoom changes occur
Current zoom level (1 = 100%, 2 = 200%, etc.)
Whether zoom functionality is currently enabled
Current X position of the zoomed image in pixels
Current Y position of the zoomed image in pixels
Current rotation angle in degrees
Function to get the current state imperatively. Returns the current
ZoomImageWheelState or undefined if not initialized.Function to programmatically update the zoom state
Partial state object to update
Options
Maximum zoom level allowed
Zoom sensitivity for mouse wheel events
Duration in milliseconds for double-tap zoom animation
Initial state values for zoom, rotation, and position
Function that returns whether single-touch panning should be enabled. Defaults to always returning
true.Specific element to apply zoom transform to. Defaults to the first
img element inside the container.Example
Cleanup
The hook automatically cleans up event listeners and subscriptions when the component unmounts. You don’t need to manually call cleanup.See Also
- createZoomImageWheel - Core API documentation
- useZoomImageHover - Hover-based zoom hook
- useZoomImageMove - Move-based zoom hook