Skip to content

Empty state

A centered icon, title, description and actions for a place that has nothing to show yet.

ui.empty_state · Category: Feedback · Full reference →

Empty stateEmpty state
  • For an empty list, a search with no results, or a panel before the first file is opened.
  • Offer the next step as an action (Create, Clear filters, Open folder).
from pyzed import ui
ui.empty_state("No results", "Try a different search.", icon="search",
actions=[ui.button("Clear filters", on_clear, size="sm")])
Empty state: Title onlyEmpty state: Title only
Title only
Code
ui.empty_state("No notifications")
Empty state: With a descriptionEmpty state: With a description
With a description
Code
ui.empty_state("No results", "Try a different search.", icon="search")
Empty state: actions=Empty state: actions=
actions=
Code
ui.empty_state("No projects yet", "Create one to get started.", icon="folder-plus",
actions=[ui.button("New project", on_new, variant="solid", size="sm")])
Empty state: size="sm", height="shrink"Empty state: size="sm", height="shrink"
size="sm", height="shrink"
Code
ui.empty_state("No results", "Try another search", icon="search", size="sm", height="shrink")
Empty state: size="lg"Empty state: size="lg"
size="lg"
Code
ui.empty_state("No projects", "Create one to start", icon="folder", size="lg", height=220)

Empty state has no events of its own: it shows what you give it. Like every widget it also has the 18 common events (click, double_click, right_click, mouse_enter, drag, key_down, resize…), attached with .on(...): see Events and Events of every component.

empty_state(
title,
description=None,
*,
icon='inbox',
actions=(),
size='md',
height='fill',
theme=None,
)

A centered placeholder for empty lists, searches with no results, etc.

Property Default Description
title required Title.
description None Secondary text.
icon "inbox" Name of a Lucide icon (pyzed icons lists them).
actions () Extra widgets (usually buttons) shown as actions.
size "md" "sm", "md" or "lg".
height "fill" "fill" (default), pixels or "shrink".
theme None Theme to use instead of the current one (pyzed.theme.current()).

Full reference →