gpui-kit GitHub

Scenes

browser-panel

Builds BrowserPanel

browser-panel in the dark theme
studio-dark
browser-panel 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 browser_panel(_window: &mut Window, cx: &mut App) -> AnyElement {
    let theme = cx.theme().clone();
    stack(&theme)
        .child(
            row(&theme)
                .items_start()
                .child(
                    div().w(px(360.0)).h(px(220.0)).child(
                        BrowserPanel::new("scene.browser.unavailable")
                            .url("https://docs.example.com/guide")
                            .on_reload(|_, _| {}),
                    ),
                )
                .child(
                    div().w(px(360.0)).h(px(220.0)).child(
                        BrowserPanel::new("scene.browser.refused")
                            .url("https://internal.example.com/admin")
                            .state(ViewportState::Refused(
                                "The workspace policy does not allow this host.".into(),
                            ))
                            .on_back(|_, _| {})
                            .on_reload(|_, _| {}),
                    ),
                ),
        )
        .into_any_element()
}