impulse_thaw/divider/
mod.rs1use leptos::prelude::*;
2use thaw_components::OptionComp;
3use thaw_utils::{class_list, mount_style};
4
5#[component]
6pub fn Divider(
7 #[prop(optional, into)] class: MaybeProp<String>,
8 #[prop(optional, into)]
10 vertical: Signal<bool>,
11 #[prop(optional)] children: Option<Children>,
12) -> impl IntoView {
13 mount_style("divider", include_str!("./divider.css"));
14
15 view! {
16 <div
17 class=class_list![
18 "thaw-divider",
19 ("thaw-divider--vertical", move || vertical.get()),
20 class
21 ]
22 aria-orientation=move || if vertical.get() { "vertical" } else { "horizontal" }
23 role="separator"
24 >
25 <OptionComp value=children let:children>
26 <div class="thaw-divider__wrapper">{children()}</div>
27 </OptionComp>
28 </div>
29 }
30}