leptos_use

Function use_device_orientation

Source
pub fn use_device_orientation() -> UseDeviceOrientationReturn
Expand description

Reactive DeviceOrientationEvent.

Provide web developers with information from the physical orientation of the device running the web page.

§Demo

Link to Demo

§Usage

let UseDeviceOrientationReturn {
    is_supported,
    absolute,
    alpha,
    beta,
    gamma,
} = use_device_orientation();

§Server-Side Rendering

On the server this function returns values as if the orientation capabilties were not supported by the device.