gpui-kit GitHub

Components

ToastLayer view

The stack of notifications for one window.

A view survives a frame. Hold it in an Entity with cx.new(..) and reach it with .update(..).

use gpui_kit::overlay::ToastLayer;

Construct

new(cx: &mut Context<Self>) -> Self

Options

Chain onto the value.

corner(corner: ToastCorner) -> Self
capacity(capacity: usize) -> Self

Commands

Need a Context, so they need a view.

push(toast: Toast, cx: &mut Context<Self>)
dismiss(ident: &str, cx: &mut Context<Self>) -> bool
clear(cx: &mut Context<Self>)

Queries

Only answer; they change nothing.

len() -> usize
is_empty() -> bool
phase(ident: &str) -> Option<Phase>

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/overlay/toast.rs