sidebar 0.0.1

🗃️ A highly customizable sidebar component for WASM frameworks like Yew, Dioxus, and Leptos.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::rc::Rc;
use yew::prelude::*;

#[derive(Clone, PartialEq)]
pub struct SidebarConfig {
    pub is_collapsed: bool,
}

#[derive(Clone, PartialEq)]
pub struct SidebarContext(pub Rc<UseStateHandle<SidebarConfig>>);

#[hook]
pub fn use_sidebar() -> SidebarContext {
    use_context::<SidebarContext>().expect("SidebarContext not found")
}