fn
useDeviceOrientation
v0.0.15testeddemoReactive [`DeviceOrientationEvent`](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent). Provides physical orientation of the device relative to Earth's coordinate frame.
Example
ts
const { isSupported, isAbsolute, alpha, beta, gamma } = useDeviceOrientation();Demo
Loading demo…
Signature
ts
export function useDeviceOrientation(options: UseDeviceOrientationOptions ={ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
options? | UseDeviceOrientationOptions | Options |
Returns
UseDeviceOrientationReturn`isSupported`, `isAbsolute`, and the `alpha`/`beta`/`gamma` angles