Skip to main content

nav_items

Function nav_items 

Source
pub fn nav_items<T: Clone + 'static, K: 'static>(
    items: impl Fn() -> Vec<T> + 'static,
    map: impl Fn(&T) -> NavItem<K> + 'static,
) -> NavItems<K>
Expand description

A data-driven item block: nav_items(move || st.feeds.get(), |f| item(f.id, f.name).icon(…)) (docs/navigation.md). items is a tracked reader (a Signal<Vec<T>> via its Fn() deref, or a closure); the block re-derives whenever it changes: rows are added and removed on the native sidebar/tab widget, and if the selected key disappears the selection resets (to None for an Option key). Static items and blocks may be mixed; the final list is their declaration order. A row without its own page is built by the nav’s Nav::destination.

Day API ↩ Guides· daybrite.dev