gpui-kit GitHub

Scenes

calendar

Builds Button Calendar DateInput Overlay RangePicker TimeInput

calendar in the dark theme
studio-dark
calendar 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.

    pub(super) fn calendar(window: &mut Window, cx: &mut App) -> AnyElement {
        ensure(window, cx);
        let theme = cx.theme().clone();
        let dates = cx.global::<SceneDates>();
        let (month, unknown) = (dates.month.clone(), dates.unknown.clone());
        stack(&theme)
            .child(
                row(&theme)
                    .items_start()
                    .gap(px(theme.space(Space::Lg)))
                    .child(month)
                    .child(unknown),
            )
            .child(
                div()
                    .max_w(px(560.0))
                    .text_color(theme.colors.text_muted)
                    .child(
                        "Every weekday name, month name, and blocked reason above came from the \
                         host. The calendar on the right has no today, so it draws no ring and \
                         guesses no month.",
                    ),
            )
            .into_any_element()
    }