soma-ui 0.1.1

A Leptos 0.8 component library: 160+ accessible UI components, blocks, charts, and a ChartDB-style schema diagram — with a prebuilt stylesheet.
Documentation
use leptos::prelude::*;

#[derive(Debug, Clone, PartialEq, Default)]
pub enum Orientation {
    #[default]
    Horizontal,
    Vertical,
}

#[component]
pub fn Separator(
    #[prop(default = Orientation::Horizontal)] orientation: Orientation,
    #[prop(default = String::new())] class: String,
) -> impl IntoView {
    let (orientation_class, role_attr) = match orientation {
        Orientation::Horizontal => ("h-px w-full bg-border", "separator"),
        Orientation::Vertical => ("w-px h-full bg-border", "separator"),
    };

    let combined = format!("{} {}", orientation_class, class);

    view! {
        <div
            role=role_attr
            aria-orientation=match orientation {
                Orientation::Horizontal => "horizontal",
                Orientation::Vertical => "vertical",
            }
            class=combined
        />
    }
}