gpui-kit GitHub

Scenes

popover

Builds Avatar Button Checkbox CommandPalette ContextMenu DescriptionList Divider EmptyState Icon List Menu Popover ProgressBar Tag Timeline

popover in the dark theme
studio-dark
popover in the light theme
studio-light

The code that drew it

A still frame holds a repeating animation at its first frame and a one-shot at its last, because a still of a moving thing is not reproducible. Run the gallery to review motion.

fn popover(window: &mut Window, cx: &mut App) -> AnyElement {
    ensure_menus(window, cx);
    let popover = cx.global::<SceneMenus>().popover.clone();
    let theme = cx.theme().clone();
    stack(&theme)
        .w(px(520.0))
        .h(px(320.0))
        // The trigger keeps its place while the surface is open, because the
        // surface is anchored to it rather than laid out beside it.
        .child(div().child("The trigger owns whether the surface is open."))
        .child(popover)
        .into_any_element()
}