R
fn

useDeviceOrientation

v0.0.15testeddemo

Reactive [`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

ParameterTypeDescription
options?UseDeviceOrientationOptionsOptions

Returns

UseDeviceOrientationReturn`isSupported`, `isAbsolute`, and the `alpha`/`beta`/`gamma` angles