Empty state
Fills an empty list or pane: an icon, what is empty, one line on why, and an optional action.
Nothing archived yet
Archived projects show up here. Archiving keeps their files and summaries.
No matches
Nothing in this workspace mentions "refund policy".
Usage
use hydroxy_leptos::empty_state::EmptyState;
use hydroxy_leptos::icon::IconName;
use leptos::prelude::*;
pub fn demo() -> AnyView {
view! {
<div style="display: grid; gap: var(--space-5);">
<EmptyState
title="Nothing archived yet"
description="Archived projects show up here. Archiving keeps their files and summaries."
>
<a href="#/button">"Open the project list"</a>
</EmptyState>
<div style="border: 1px dashed var(--border-2); border-radius: var(--radius-lg);">
<EmptyState
icon=IconName::Search
title="No matches"
description="Nothing in this workspace mentions \"refund policy\"."
/>
</div>
</div>
}
.into_any()
}use dioxus::prelude::*;
use hydroxy_dioxus::empty_state::EmptyState;
use hydroxy_dioxus::icon::IconName;
#[component]
pub fn EmptyStateDemo() -> Element {
rsx! {
div { style: "display: grid; gap: var(--space-5);",
EmptyState {
title: "Nothing archived yet",
description: "Archived projects show up here. Archiving keeps their files and summaries.",
a { href: "#", "Open the project list" }
}
div { style: "border: 1px dashed var(--border-2); border-radius: var(--radius-lg);",
EmptyState {
icon: IconName::Search,
title: "No matches",
description: "Nothing in this workspace mentions \"refund policy\".",
}
}
}
}
}
Anatomy
| Component | data-part | Renders |
|---|---|---|
EmptyState | root | <div>, centred column |
(inside) | icon | 40px icon in a 64px sunken tile |
(inside) | title | What is empty |
(inside) | description | Optional line, max 36 characters wide |
(inside) | action | The children, when given |
Props
| Prop | Type | Notes |
|---|---|---|
icon | IconName | Default Inbox |
title | String | Required. Such as "Nothing archived yet" |
description | Option<String> | One line on why, or what fills it |
children | Children | Optional action, such as a button |