Worklist — Empty
Anatomy
blocks::worklist::empty is for a genuinely empty collection. State what is missing, why the first entry helps, and name the create action. Keep the composition left aligned with the list it will replace.
use maud_ui::blocks::{action::Link, worklist::empty::{self, Props}};
let empty = empty::render(Props {
title: "No notes yet".into(),
description: Some("Keep arrival requests and handover details together.".into()),
create: Some(Link { label: "Create your first note".into(), href: "/notes/new".into() }),
..Default::default()
});
Omit create when that action is not available to the viewer. Do not infer permission from an empty response, and do not use this block while a request is pending or failed. A search with no matches should use Search results, retaining its query and clear action. Related-record lists may retain their quieter one-line empty state.
maud_ui::blocks::worklist::empty
Props
Generated from public Rust fields. Defaults are evaluated from the implementation.
| Prop | Type | Default | Description |
|---|---|---|---|
title | String | "No records yet" | No description |
description | Option<String> | None | No description |
create | Option<Link> | None | Only provide creation when the caller has admitted that action. |
heading | Heading | H2 | No description |
Examples
light · fictional example
dark · fictional example
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.