Skip to content

useDeviceOrientation ​

sensors
test coverage
Last changed: 28 days ago

TIP

This hook uses DeviceOrientationEvent browser api to provide enhanced functionality. Make sure to check for compatibility with different browsers when using this api

Hook that provides the current device orientation

typescript
import { useDeviceOrientation } from '@siberiacancode/reactuse';

Usage ​

typescript
const { supported, value } = useDeviceOrientation();

Demo ​

Api ​

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarbabin

Released under the MIT License.