Components / Content

Empty state

Markdown crates/ui/src/widgets/content.rs docs.rs

Empty state

Ask your agent

Install the bezel skill once

npx skills add crabtalk/bezel --skill bezel

Then ask

When the project has no repositories, show an empty state with a folder icon and an "Open folder" button under it.
use ui::{icons, widgets::{Button, Content}};

theme
    .empty_state(icons::glyph::Folder, "No repositories", "Open a folder to get started.")
    .child(Button::new("open", "Open folder").on_press(cx.listener(|view, _, _, cx| view.open(cx))))
  • There is no action slot; an action is a child you add.
  • It fills its parent's width and centres in it.