Expand description
Mobiler’s fixed UI wire ABI.
These types are the stable contract between any Mobiler app’s Rust core and the native shell. Because they never change per app, a single shell is built once and renders any Mobiler app — the shell only ever knows these types, never an app’s domain events or widgets.
- The core emits a
Widgettree (theViewModel). - The shell sends back an
Action(theEvent). - App domain events ride inside actions as opaque
ActionTokens that the shell round-trips without interpreting.
Style is expressed as intent tokens (e.g. TextStyle, Tone); the
shell maps each to a concrete look (font, color, dp), so dark mode and theme
come for free on the native side.
Structs§
- Chart
Bracket - A right-side bracket annotation spanning
[y0, y1]with alabelnote (e.g. a ceiling band). - Chart
Legend Item - One legend entry (swatch + name) for a
Widget::RegionChart. - Chart
RefLine - A horizontal reference line across a
Widget::RegionChartatvalue, with a right-edgelabelchip.dasheddraws it dashed (e.g. a “max insured” ceiling) vs solid (a target). - Chart
Region - One rectangle in a
Widget::RegionChart, spanning[x0, x1]horizontally and[y0, y1]vertically in the chart’s domain.labelis centered inside (empty = none);verticalrotates it 90° for narrow columns.coloroverrides the auto-assigned palette slot. - Chart
Series - One named data series in a
Widget::Chart. Cartesian styles plotvaluesacross the chart’s x-axislabels; circular styles (pie/donut/rings/gauge) collapse the series to a single magnitude (valuessummed).coloroverrides the auto-assigned palette slot;goalis the denominator forRings/Gaugeprogress (ignored by the other styles). - Chart
Tick - An x-axis tick on a
Widget::RegionChartat domain positionat, labelledlabel. Ticks are irregular (the app places them), so shells position them by fraction, not even spacing. - Fab
- A floating action button anchored over the scaffold body (the raised primary action).
- Rgb
- A 24-bit RGB color. Used for a theme’s brand/seed color — the one place an app supplies an arbitrary color (everything else is intent tokens).
- Segment
- One option in a
Widget::Segmentedcontrol (mirrorsTab).selectedmarks the active segment; tapping sendson_select. - Sheet
- A modal bottom sheet anchored over the scaffold body (a scrim behind, a panel rising from
the bottom). Present (
Some) ⇒ open; tapping the scrim/handle sendson_dismiss. - Swipe
Button - One revealed action in a
SwipeActionrow (swipe to reveal, tap to fire). - Tab
- A bottom-navigation tab.
selectedmarks the active one; tapping sendson_select.icon(optional) renders above the label for an icon tab bar. - Theme
- App branding as data — the visual twin of
dark_mode. Set on aWidget::Scaffold(theme: None= the framework defaults, i.e. no visual change). The shell maps these to its native theming:seed→ the brand/primary color (Android M3 scheme / iOS tint / web--primary), plus a global corner, spacing, and font choice.
Enums§
- Action
- What the shell sends back to the core. Fixed across all apps.
- BoxAlign
- Button
Style - Card
Style - Chart
Style - How a
Chartdraws its series. - Corner
- Global corner-radius scale.
Medium≈ the current (un-themed) look. - Density
- Global spacing scale.
Comfortable≈ the current (un-themed) spacing. - Field
Kind - What a
Widget::TextFieldaccepts — selects the on-screen keyboard, secure (masked) entry, and single- vs multi-line layout in one axis. - Font
Family - A finite, cross-platform font family (maps to each platform’s nearest system
font design — no bundled font files).
System≈ the current look. - Icon
- A finite icon set (maps to Material icons / SF Symbols / web glyphs per shell). Grouped: editing, navigation/chrome, content, and domain icons.
- Image
Ratio - Image
Shape - Input
Value - A value produced by an input widget at runtime.
- Project
Color - Project-identity colors (distinct from semantic
Tone). Concrete RGB decided in the render layer. - Spacing
- Text
Style - Tone
- Semantic status color (distinct from brand/identity color).
- Widget
- The app-agnostic widget tree the shell renders. Fixed across all apps.
Type Aliases§
- Action
Token - An opaque, serialized app event (e.g. JSON of the app’s domain action).