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::*;

#[component]
pub fn Card(#[prop(default = String::new())] class: String, children: Children) -> impl IntoView {
    let combined = format!(
        "bg-card border border-border rounded-md text-card-foreground shadow-elev-sm {}",
        class
    );
    view! { <div class=combined>{children()}</div> }
}

#[component]
pub fn CardHeader(
    #[prop(default = String::new())] class: String,
    children: Children,
) -> impl IntoView {
    let combined = format!("flex flex-col space-y-1.5 p-6 {}", class);
    view! { <div class=combined>{children()}</div> }
}

#[component]
pub fn CardTitle(
    #[prop(default = String::new())] class: String,
    children: Children,
) -> impl IntoView {
    let combined = format!(
        "font-heading text-2xl font-semibold leading-none tracking-tight {}",
        class
    );
    view! { <h3 class=combined>{children()}</h3> }
}

#[component]
pub fn CardDescription(
    #[prop(default = String::new())] class: String,
    children: Children,
) -> impl IntoView {
    let combined = format!("text-sm text-muted-foreground {}", class);
    view! { <p class=combined>{children()}</p> }
}

#[component]
pub fn CardContent(
    #[prop(default = String::new())] class: String,
    children: Children,
) -> impl IntoView {
    let combined = format!("p-6 pt-0 {}", class);
    view! { <div class=combined>{children()}</div> }
}

#[component]
pub fn CardFooter(
    #[prop(default = String::new())] class: String,
    children: Children,
) -> impl IntoView {
    let combined = format!("flex items-center p-6 pt-0 {}", class);
    view! { <div class=combined>{children()}</div> }
}