• English
  • RUST + LVGL / WEBASSEMBLY

    Component preview

    Browse the categories in the studio sidebar and try the controls. The browser and desktop versions use the same Rust views.

    Rust source for the selected category rs_lvgl_ui/examples/studio/pages.rs:65

    This excerpt is compiled into the preview above. Shared helpers and state live in studio.rs. Try supported UI code in the browser playground; use its optional local compiler for the full studio source.

    rs_lvgl_ui/examples/studio/pages.rs:65
    fn overview(app: &Studio, theme: &Theme) -> View<StudioAction> {
        let plot = card(
            "A live workspace",
            "Synthetic signal / last 12 samples",
            theme,
        )
        .width(percent(64))
        .height(px(326))
        .child(studio_row().children([
            metric("84.2", "Signal strength", ORANGE, theme),
            metric("12", "Sample points", TEAL, theme),
        ]))
        .child(signal_chart(134));
        let control = card("Try the controls", "Changes carry between pages.", theme)
            .width(percent(34))
            .height(px(326))
            .child(
                studio_row()
                    .justify_content(FlexAlign::SpaceBetween)
                    .align_items(ItemAlign::Center)
                    .align_content(FlexAlign::Center)
                    .child(metric(
                        &format!("{}%", app.value),
                        "Output level",
                        theme.text,
                        theme,
                    ))
                    .child(
                        switch(app.enabled)
                            .focusable(true)
                            .on_value_changed(|v| StudioAction::Enabled(v != 0)),
                    ),
            )
            .child(
                slider(0, 100, app.value)
                    .key(Key::Named("overview-slider"))
                    .style(full(12))
                    .focusable(true)
                    .on_value_changed(StudioAction::Value),
            )
            .child(primary("Explore components", StudioAction::Page(1), theme).style(full(44)))
            .child(text("Touch, click or use Tab + Enter.", theme));
        studio_column()
            .child(studio_row().children([plot, control]))
            .child(
                studio_row().children([
                    third(
                        card("Compose", "Small nodes. Complete interfaces.", theme),
                        242,
                    )
                    .child(
                        spans([
                            Span::new("App").color(ORANGE),
                            Span::new("  /  View  /  "),
                            Span::new("Ui").color(TEAL),
                        ])
                        .style(full(40).font(Font::montserrat_20())),
                    )
                    .child(action_button(
                        "Open composition",
                        StudioAction::Page(7),
                        theme,
                    )),
                    third(
                        card("Create", "Pixels, motion and vector media.", theme),
                        242,
                    )
                    .child(studio_row().children([
                        rs_lvgl_ui::image(sample_image(false)),
                        text("Made for your device.", theme),
                    ]))
                    .child(action_button("Open media", StudioAction::Page(5), theme)),
                    third(
                        card("Connect", "A native engine, a Rust workflow.", theme),
                        242,
                    )
                    .child(
                        studio_row().height(px(38)).children([
                            led(TEAL)
                                .width(px(18))
                                .height(px(18))
                                .radius(9)
                                .shadow_width(0),
                            text("LVGL 9.6 / native rendering", theme),
                        ]),
                    )
                    .child(action_button(
                        "Open a dialog",
                        StudioAction::Dialog(true),
                        theme,
                    )),
                ]),
            )
    }

    Eleven categories include native controls, text and Pinyin input, charts, layouts, GIF/Lottie, canvas motion, dialogs, navigation and raw native widgets, plus control and chart depth examples. Use the in-canvas sidebar to switch pages; the source excerpt follows your selection.

    The studio is precompiled WebAssembly and works on static hosting. The playground supports browser editing for a documented Rust subset, with an optional local compiler for full Rust. The browser canvas demonstrates LVGL rendering and interaction; device drivers and physical displays are validated on their target hardware.