orbital-base-components 0.1.1

Headless base primitives for Orbital — structure, semantics, and accessibility
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Resolve a DOM element by its `id` attribute for external anchor positioning.
#[cfg(not(feature = "ssr"))]
pub fn resolve_external_anchor(id: &str) -> Option<web_sys::Element> {
    if id.is_empty() {
        return None;
    }
    leptos::prelude::document().get_element_by_id(id)
}

/// SSR stub — no DOM available at render time.
#[cfg(feature = "ssr")]
pub fn resolve_external_anchor(_id: &str) -> Option<web_sys::Element> {
    None
}