Skip to main content

ui_storybook/components/menus/
menu_section.rs

1//! `MenuSection` — optional group heading + child rows (M-UI.3 /
2//! AUT-123).
3
4use leptos::prelude::*;
5
6#[component]
7pub fn MenuSection(
8    /// Optional uppercase section heading rendered above the rows. Pass
9    /// `None` to skip the heading.
10    #[prop(optional, into)]
11    heading: Option<String>,
12    children: Children,
13) -> impl IntoView {
14    view! {
15        <li class="menu-section" role="presentation">
16            {heading.map(|h| view! { <div class="menu-section-heading">{h}</div> })}
17            <ul class="menu-section-rows" role="group">{children()}</ul>
18        </li>
19    }
20}