Leptos-Use Guide

use_device_orientation

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

Demo

Usage

use leptos::*;
use leptos_use::{use_device_orientation, UseDeviceOrientationReturn};

#[component]
fn Demo() -> impl IntoView {
let UseDeviceOrientationReturn {
    is_supported,
    absolute,
    alpha,
    beta,
    gamma,
} = use_device_orientation();

view! { }
}

Server-Side Rendering

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

Types

Source

SourceDemoDocs