nightshade-api 0.51.0

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

/// A framed section, typically for editor sidebars. A non-empty `title` renders
/// a header above the `children`, which fill the panel body.
#[component]
pub fn Panel(
    #[prop(into, optional)] title: String,
    #[prop(into, optional)] class: String,
    children: Children,
) -> impl IntoView {
    let header = (!title.is_empty())
        .then(|| view! { <div class="nightshade-panel-title">{title.clone()}</div> });
    view! {
        <div class=format!("nightshade-panel {class}")>
            {header}
            <div class="nightshade-panel-body">{children()}</div>
        </div>
    }
}