Expand description
Mobiler runtime — the developer-facing API.
Implement MobilerApp with your typed events, model, and view (built
from the builders). Mobiler wraps it in MobilerShell, a
Crux app speaking the fixed UI ABI (mobiler_ui); you never touch the wire
protocol. Device APIs are capabilities via Cx.
Structs§
- 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). - Cx
- Effects an app requests during
update, generic over the app event type so continuations stay fully typed. - Fab
- A floating action button anchored over the scaffold body (the raised primary action).
- Mobiler
Shell - Crux adapter: turns a
MobilerAppinto an app speaking the fixed ABI. - Nav
- A navigation stack the app holds in its
Model. The core owns the stack (single source of truth); the framework reads itsroute/depthto drive the shell’s push/pop transitions and back button. - Plugin
Call - Plugin
Notify - Plugin
Response - 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. - Effect
- Built-in capabilities the generic shell fulfils.
- Effect
Ffi - 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.
Traits§
- Mobiler
App - What a Mobiler app implements. Write typed domain events; Mobiler serializes them into opaque tokens behind the scenes.
Functions§
- avatar
- A circular avatar image.
- avatar_
status - A circular avatar image with a colored status dot.
- badge
- bar_
chart - A bar chart of
values(normalized to the max), with optional per-valuelabels. Single-series, no axis or legend — for richer charts usechart. - button
- calendar
- An inline month calendar for
year/month(1–12).on_day(d)builds the tap event for each daydin the month;selectedhighlights a day. Leading blanks + weekday header are handled by the shells from the computedfirst_weekday. - caption
- card
- card_
button - A tappable card carrying a typed press event.
- chart
- A multi-series chart in the given
style, with optional x-axislabels, y-axisgridlines/ ticks (cartesian styles), and a serieslegend. The general builder behind the convenience constructors below. - checkbox
- chip
- color_
dot - A small colored identity dot.
- column
- divider
- donut_
chart - A donut chart (pie with a center hole). Legend on.
- emphasis
- gauge_
chart - A single radial gauge — the first series’
value / goalwith the number in the center. - grid
- icon_
button - image
- line_
chart - A line chart of
values(normalized to the max), with optional per-valuelabels. Single-series, no axis or legend — for richer charts usechart. - nav_
scaffold - Scaffold driven by a
Navstack: fillsroute(from the current route’s serialization) anddepth(stack depth) so the shell animates transitions, and shows a back affordance (top-bar arrow + system back button) firingon_backwhenever the stack can pop. - pct_
stacked_ bar_ chart - Bars where each x-slot fills to 100% — series as proportions. Legend on, no value axis.
- pie_
chart - A pie chart — each series is one wedge sized by its magnitude. Legend on.
- progress
- A progress bar (
Some(0.0..=1.0)) or an indeterminate spinner (None). - rating
- A read-only star rating.
valueis in tenths (e.g.48= 4.8 ofmaxstars). - rating_
input - A tappable star rating —
on_ratecarries one event per star (star i fireson_rate[i]). - rings_
chart - Concentric progress rings — one per series, swept by
sum(values) / goal. Legend on. Give each series a goal viaChartSeries::with_goal. - row
- scaffold
- App shell: top bar + bottom-nav
tabs+ scrollablebody.dark_modeis theme-as-data (the shell themes the whole app from it). - scaffold_
back - Like
scaffold, but the top bar (and the system back button) navigate back viaback— e.g. a detail screen pushed over a tab (treated as depth 2). For multi-level stacks, drive navigation withNav+nav_scaffold. - scroller
- Horizontally scrolling row of children (a carousel / chip rail).
- search_
field - A search input (leading magnifier, pill); emits
Input { id, Text }liketext_field. - segment
- One option in a
segmentedcontrol, carrying a typed selection event. - segmented
- A single-choice segmented control (exclusive options in a pill).
- skeleton
- A shimmer placeholder shown while content loads.
- slider
- spacer
- stack
- Z-stack/overlay (the
Boxwidget). Withscrim, the first child is a darkened background and the rest render on top. - stacked_
bar_ chart - Bars stacked to a total per x-slot. Axis + legend on by default.
- stepper
- styled
- subtitle
- swipe_
action - A list row that reveals trailing
actions(label, tone, event) on horizontal swipe; each is tappable. On web the actions render inline (no gesture). - tab
- A bottom-nav tab carrying a typed selection event (label-only).
- tab_
icon - A bottom-nav tab with a leading icon (icon tab bar).
- text
- text_
field - title
- toggle
- with_
fab - Anchor a floating action button over a scaffold’s body (the raised primary action).
No-op on any other widget:
with_fab(scaffold(...), Icon::Add, Msg::New). - with_
refresh - Enable pull-to-refresh on a scaffold’s body: the body becomes pull-refreshable and fires
on_refreshon pull.refreshingis app-owned — set it true when the pull fires and clear it when the async reload completes (the shell shows a spinner while true). No-op on other widgets. - with_
sheet - Open a modal bottom sheet over a scaffold’s body. No-op on any other widget — drive it from
the model:
with_sheet(scaffold(...), title, sheet_body, Msg::CloseSheet). - with_
theme - Apply a
Themeto a scaffold (brand color, corner, density, font). No-op on any other widget. Lets an app brand its UI without new scaffold builder overloads:with_theme(nav_scaffold(...), Theme { seed, ..Default::default() }).