Loading...
Please waitLoading...
Please waitpnpm dlx uselab@latest add use-orientation
import * as React from "react"
import { useOrientation } from "@/hooks/use-orientation"
export function Component() {
const { angle, type } = useOrientation()
return (
<div>
<p>Orientation Type: {type}</p>
<p>Rotation Angle: {angle}°</p>
</div>
)
}| Name | Type | Description |
|---|---|---|
angle | number | The current orientation angle of the device in degrees. |
type | string | The current orientation type of the device (e.g., portrait-primary, landscape-primary, portrait-secondary, landscape-secondary). If the type cannot be determined, it is UNKNOWN. |