Skip to content

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.

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.

GroupPageHolds
App structurescreensScreen: what a screen is, and every method the runtime calls
appApp, AppShell, Driver, Runtime: the loop a host runs
navigationpresent, finish_screen, NavigationScreen, OverlayPanel, Hint, Navigator, and a two-screen walkthrough
Views & layoutviewsView, ViewExt, Mapped: boxing, measuring, components and .map
stacksVStack, HStack, vstack!, hstack!, Alignment: how a stack measures
layoutSpacer, Padding, ScrollView, UNBOUNDED
modifiersModifiers, Frame, Flexible, Tappable
Componentstext and fontsText, Font, FontId, FontRole, FontStyle
imagesImage, Icon, IconRef
controlsSlider, and how a value control takes the keys
steppersStepper
togglesToggle, IconToggle
listsList, ListRow, list!, Section, Divider
dialogsModal, Scrim
indicatorsProgressBar
InputinputButton, SwipeDir, Input: how input reaches a screen
key rowsKeyRow, RowKey: what the keys along the bottom edge mean
interactionsInputMask, Interaction, Interactions: how a view declares where it can be touched
triggersTrigger, value_at: what an interaction produces when it fires
HostthemeTheme, ThemeMetric, ControlState: the theme's geometry and furniture
drawing and repaintingRenderer, ScreenChrome, millis, request_update: the framebuffer, the header and hints, the clock and a repaint
geometryPoint, Size, Rect, Insets
the backend contractHost, InputSource, Clock, and installing a host and a navigator
canvas and chromeCanvas, TextMetrics, Chrome, RowField: what a backend draws with
Testingtestinginstall, install_forced, TestHost, reset, the counters and the metrics: the fake host
driving a screenUi, 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
recordingRecorder, 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.

In screens, and the loop that drives one in app.

In stacks, layout, modifiers and views.

In text and fonts, images, controls, steppers, toggles, lists, dialogs and indicators.

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.

In views, under ViewExt::map.

In navigation.

In navigation, and App in app.

In text and fonts.

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.

In geometry.