Declarative UI for e-Paper, in Rust.

Small, no_std, dependency-free. You write the screen, the framework handles layout, focus, input and the redraw.

Get startedDocumentation

The gallery's menu on an Xteink X3

A screen

Describe it. xpui draws it.

fn body(&self) -> impl View<Self::Message> {
  NavigationScreen::new(ScrollView::new(vstack![14;
    // A stepper is one focus stop but three touch targets: the two
    // glyphs nudge, the track sets an absolute value.
    // The name and the number are the control's, not the screen's. A
    // screen cannot draw the number: while an edit is open the
    // framework holds the value and does not tell the screen, so a
    // label built in `update` stands still while the track moves.
    Stepper::new(self.brightness)
      .on_change(ControlsMsg::Brightness)
      .on_step(ControlsMsg::BrightnessStep)
      .title("Brightness")
      .readout("%"),

    Slider::new(self.warmth, 100)
      .on_change(ControlsMsg::Warmth)
      .title("Warmth")
      .readout("%"),

    Divider::new(),

    Toggle::new("Frontlight", self.frontlight, "On", "Off")
      .on_change(ControlsMsg::Frontlight),

    Text::new("Downloading").font(Font::ui_small()),
    ProgressBar::percent(self.downloaded),
  ]))
  .title("Controls")
  .hints(
    Hint::Standard,
    Hint::Standard,
    Hint::text("-"),
    Hint::text("+"),
  )
}
The controls screen: brightness and warmth steppers, and a frontlight toggle
The gallery's Controls screen, lines 57–91, beside the golden its conformance tests compare against.

Repositories

Every arrow points inward.

The framework

xpui-framework

The framework itself, and the orientation for the project

Building blocks

xpui-chrome

The eight themed components a backend paints, from drawing primitives alone

xpui-boards

Eight devices as data: panel size, key row, and the body in tenths of a millimetre

xpui-backends

Two backends: embedded-graphics, and FreeInkUI over a C ABI

Tools

xpui-simulator

An xpui app in a desktop window, on any board's panel

xpui-gallery

The reference application, and the eight-board conformance suite it doubles as

On a device

xpui-rp2040

The gallery as firmware, run on the Pimoroni Badger 2040 and Tufty 2040

xpui-esp32

The gallery as firmware for the Xteink X3 and the Seeed Sticky — both images build; no panel driver yet

xpui-cpp

Hosting xpui screens inside a C++ firmware, over a stable C ABI