Reference
The whole of the public API, by area. architecture.md explains how a frame runs and tutorial.md builds one screen from nothing; this is what you reach for once you know the shape and want to know what exists.
Topics
Section titled “Topics”Each page lists every public name in its area with its declaration, its parameters, examples you can copy, and a picture of whatever it draws. The gate checks every page against the code: every public name has a section, and what a page says an item is, rustdoc says too.
| Group | Page | Holds |
|---|---|---|
| App structure | screens | Screen: what a screen is, and every method the runtime calls |
| app | App, AppShell, Driver, Runtime: the loop a host runs | |
| navigation | present, finish_screen, NavigationScreen, OverlayPanel, Hint, Navigator, and a two-screen walkthrough | |
| Views & layout | views | View, ViewExt, Mapped: boxing, measuring, components and .map |
| stacks | VStack, HStack, vstack!, hstack!, Alignment: how a stack measures | |
| layout | Spacer, Padding, ScrollView, UNBOUNDED | |
| modifiers | Modifiers, Frame, Flexible, Tappable | |
| Components | text and fonts | Text, Font, FontId, FontRole, FontStyle |
| images | Image, Icon, IconRef | |
| controls | Slider, and how a value control takes the keys | |
| steppers | Stepper | |
| toggles | Toggle, IconToggle | |
| lists | List, ListRow, list!, Section, Divider | |
| dialogs | Modal, Scrim | |
| indicators | ProgressBar | |
| Input | input | Button, SwipeDir, Input: how input reaches a screen |
| key rows | KeyRow, RowKey: what the keys along the bottom edge mean | |
| interactions | InputMask, Interaction, Interactions: how a view declares where it can be touched | |
| triggers | Trigger, value_at: what an interaction produces when it fires | |
| Host | theme | Theme, ThemeMetric, ControlState: the theme's geometry and furniture |
| drawing and repainting | Renderer, ScreenChrome, millis, request_update: the framebuffer, the header and hints, the clock and a repaint | |
| geometry | Point, Size, Rect, Insets | |
| the backend contract | Host, InputSource, Clock, and installing a host and a navigator | |
| canvas and chrome | Canvas, TextMetrics, Chrome, RowField: what a backend draws with | |
| Testing | testing | install, install_forced, TestHost, reset, the counters and the metrics: the fake host |
| driving a screen | Ui, Drive, press, hold, release, next_frame, set_swipe, set_millis, set_has_left_right_keys, set_swipe_moves_selection: driving a screen in a test | |
| recording | Recorder, DrawOp and snapshots: asserting what was drawn |
Every rust block on those pages is compiled and run by
cargo test -p xpui --features testing --doc, so a snippet that stops matching
the API fails CI rather than quietly teaching the wrong thing. Most install the
fake host first, because widgets resolve fonts and theme metrics through the
host in their constructors; those lines are hidden where they would only
clutter the prose.
The sections below are where this page used to hold that material. Each points to its page now, so an old link still lands somewhere useful.
A screen
Section titled “A screen”In screens, and the loop that drives one in app.
Layout
Section titled “Layout”In stacks, layout, modifiers and views.
Widgets
Section titled “Widgets”In text and fonts, images, controls, steppers, toggles, lists, dialogs and indicators.
Interaction
Section titled “Interaction”In input for buttons, swipes and claiming a key, key rows for the keys along the bottom edge, and interactions for how a control declares where it can be touched and focused, with triggers for what it produces when it fires. How a value control takes the keys over is in controls.
Components
Section titled “Components”In views, under ViewExt::map.
Screen roots
Section titled “Screen roots”In navigation.
Navigation
Section titled “Navigation”In navigation, and App in
app.
In text and fonts.
The host façades
Section titled “The host façades”Theme is in theme, Renderer and ScreenChrome in
drawing and repainting,
Input in input, and the traits behind them in
the backend contract and
canvas and chrome.
Geometry
Section titled “Geometry”In geometry.