Shell — App Header
Anatomy
An optional product header above the sidebar/content row. It identifies the product and offers primary links; use the separate page header for route context.
maud_ui::blocks::shell::app_header
Props
Generated from public Rust fields. Defaults are evaluated from the implementation.
| Prop | Type | Default | Description |
|---|---|---|---|
state | crate::blocks::state::State | Ready | Explicit presentation state; Ready preserves the ordinary content. |
brand | Option<Markup> | None | No description |
brand_mark | Option<super::brand_mark::Props> | None | Typed brand mark; overrides the legacy brand markup when supplied. |
links | Vec<Link> | [] | No description |
current_href | Option<String> | None | No description |
actions | Option<Markup> | None | No description |
children | Markup | PreEscaped("") | No description |
Examples
Loading, empty, error and disabled
Each example uses the block’s state prop. Empty and error are separate outcomes.
Usage and composition
Import and example
use maud::html;
use maud_ui::blocks::{action::Link, shell::{app_header, sidebar}};
sidebar::render(sidebar::Props {
app_header: app_header::render(app_header::Props {
brand: Some(html! { a href="/" { "Garden House" } }),
links: vec![Link { label: "Workspace".into(), href: "/workspace".into() }],
current_href: Some("/workspace".into()),
actions: Some(html! { a href="/account" { "My account" } }),
..Default::default()
}),
..Default::default()
});
render(Default::default()) returns empty markup. Empty brand/actions fragments also count as empty. The 56px minimum row wraps its navigation beneath the brand on phones. No JS is required. The sidebar showcase demonstrates this masthead and the footer together in both themes.
Presentation states (0.10.1)
Props::state: maud_ui::blocks::state::State defaults to Ready. Loading { message } shows skeletons; Empty { message, action } and Error { message, retry } provide distinct recovery paths; Disabled { reason } retains admitted content in an inert subtree with an external reason. Loading, empty and error omit ready content. Inert disables interaction, not server authorization or submission of values by an enclosing form. Each live API page shows all four states together. Add state: Default::default() to exhaustive Props literals.
Typed identity (0.11.0)
brand_mark: Option<shell::brand_mark::Props> defaults to None and overrides the raw brand slot when supplied. The mark contains a logo, wordmark and optional tagline. Add the new field to exhaustive Props literals. See brand mark.
State::Absent (0.11.0) means no input/rule was declared and emits nothing. Keep any caller-owned section heading inside the same conditional. Use Error only for a declared operation that failed; never show an unconfigured-rule message to the user.
Frame contract (0.12.0)
Density never moves the frame. Shell spacing, type and control heights use independent --mui-shell-* tokens. See shell frame for layout, current navigation and source migration details.
Accessibility
Supply meaningful labels, choose heading levels for the surrounding page, and preserve native link and form behavior. Keyboard focus follows document order. Motion honors reduced-motion preferences.