Getting Started
Add biji-ui to your Cargo.toml. Components are opt-in via feature flags.
# Enable only the components you need
biji-ui = { version = "0.5.0", features = ["accordion", "dialog"] }
# Or enable everything
biji-ui = { version = "0.5.0", features = ["full"] }
You can then import and start using them in your app.
use leptos::prelude::*;
use biji_ui::components::accordion;
#[component]
pub fn AccordionExample() -> impl IntoView {
let items = [
("Item 1", "Content 1"),
("Item 2", "Content 2"),
("Item 3", "Content 3"),
];
view! {
<accordion::Root>
{items
.into_iter()
.map(|(title, content)| {
view! {
<accordion::Item>
<accordion::Trigger>
{title}
<span>
<icons::Caret>
</span>
</accordion::Trigger>
<accordion::Content>
{content}
</accordion::Content>
</accordion::Item>
}
})
.collect::<Vec<_>>()}
</accordion::Root>
}
}