nightshade-api 0.51.0

Procedural high level API for the nightshade game engine
Documentation
use leptos::prelude::*;

/// A bordered content container. When `title` is non-empty it renders a header
/// row above the `children`, which fill the card body.
#[component]
pub fn Card(
    #[prop(into, optional)] title: String,
    #[prop(into, optional)] class: String,
    children: Children,
) -> impl IntoView {
    let header = (!title.is_empty())
        .then(|| view! { <div class="nightshade-card-title">{title.clone()}</div> });
    view! {
        <div class=format!("nightshade-card {class}")>
            {header}
            <div class="nightshade-card-body">{children()}</div>
        </div>
    }
}