Skip to main content

Crate frust

Crate frust 

Source
Expand description

Facade crate: the public frust framework API.

App authors depend on this single crate. It exposes run, the canonical app entry point, and curates the view/widget/reactive vocabulary from the underlying framework crates so the declarative call shape reads exactly as the spec promises:

use frust::{AnyView, Column, Component, View, any, text};

// A small stateless widget: a plain fn, generic over the state of
// whichever component places it.
fn greeting<S: 'static>(message: &str) -> impl View<S> + use<S> {
    text(message.to_owned()).size(24.0)
}

struct Counter;

impl Component for Counter {
    type State = i32;

    fn init(&self) -> i32 {
        0
    }

    // The whole UI lives in `build`; split it into widget fns like
    // `greeting` rather than nesting ever deeper inside it.
    fn build(&self, state: &mut i32) -> AnyView<i32> {
        any(Column(vec![
            any(greeting("Hello from Frust")),
            any(text(format!("count: {state}")).size(32.0)),
        ]))
    }
}

frust::run(Counter).unwrap();

The composition rule: stateless pieces are plain widget functions called from build; a piece with its own state is a child Component mounted with component, which gives it a private state boundary. run (or the app! macro, which also covers the mobile and web shells) starts it.

§Low-level escape hatch: App::new

App is the low-level primitive run and app! expand into (App::new(state, move |state| root.build(state))): a single ambient State and a build closure, with no Component state-boundary or retained local state. Ordinary apps use a Component with run or app!; reach for App::new directly only when you need that raw (state, build) pair:

struct AppState {
    greeting: String,
}

let build = |state: &mut AppState| -> frust::AnyView<AppState> {
    frust::any(frust::text(state.greeting.clone()).size(32.0))
};

frust::App::new(AppState { greeting: "Hello from Frust".into() }, build)
    .run()
    .unwrap();

§Layout containers

The primitive containers compose heterogeneous children through any (type erasure) into the declarative call shape:

use frust::{Align, Alignment, Column, EdgeInsets, Padding, Row, SizedBox, any, text};

struct Layouts;

impl frust::Component for Layouts {
    type State = ();

    fn init(&self) {}

    fn build(&self, _state: &mut ()) -> frust::AnyView<()> {
        any(Column(vec![
            any(text("title").size(24.0)),
            any(Row(vec![any(text("left")), any(text("right"))])),
            any(Padding(EdgeInsets::all(8.0), text("padded"))),
            any(Align(Alignment::CENTER, text("centered"))),
            any(SizedBox(Some(0.0), Some(12.0))),
        ]))
    }
}

Re-exports§

pub use frust_core::accesskit;
pub use kurbo;
pub use peniko;

Modules§

authoring
Everything needed to author a custom View/Widget pair.
icons
The vendored Material Symbols starter icon set, flat-re-exported so app code names frust::icons::HOME rather than the underlying frust-widgets crate. Each entry is an IconSource usable directly with icon; an app can also supply its own vector icons via IconData::from_path. Vendored Material Symbols starter set — GENERATED, do not hand-edit.
input
Pure input/gesture helpers (slop constants, input::VelocityTracker, the fling-decay math) re-exported for app authors and advanced widgets.
motion
The motion module: declarative implicit-animation wrappers (AnimatedOpacity/AnimatedScale today; switcher/patterns land later) over frust-core’s anim vocabulary. Re-exported wholesale (pub use frust_widgets::motion;), mirroring frust_widgets::icons’s existing wholesale-module precedent — the only other one in this facade — so later types under frust_widgets::motion ride along under frust::motion::* with no further facade edits (see that module’s own docs for the full rationale).

Macros§

android_app
Bind a generated app’s State/build to the fixed Android JNI exports (a Makepad app_main! precedent).
app
The canonical app entry point: one line binds a root Component to all three platforms.
ios_app
Bind a generated app’s State/build to the fixed iOS C-ABI exports (Makepad app_main! precedent).
web_app
The browser counterpart of android_app!/ios_app!: binds a Component’s state and build closure to the browser shell’s wasm-bindgen entry point. Takes the identical two-argument (state type + build expression, state built via Default) / three-argument (state type + explicit state-init expression + build expression) shape android_app! does, and app! drives it through the three-argument form exactly the way it drives android_app!/ios_app! (see @emit_mobile below) — most apps reach this through app!/web_app! rather than hand-writing the explicit state_init form.

Structs§

AlignView
A declarative alignment container. See the module docs.
Alignment
A relative alignment within a box: each axis runs -1.0 (start) through 0.0 (center) to 1.0 (end).
AlwaysScrollable
Flutter’s AlwaysScrollableScrollPhysics: accept a drag whether or not there is anything to scroll, and defer everything else to the chained parent.
AnimationController
The animation vocabulary: the shell-fed frame clock (FrameTime) plus the pure easing/interpolation/spring math a widget or app advances it through, flat-re-exported from frust-core::anim. Time enters from the shell during paint (PaintCtx::frame_time); nothing here reads a clock. A 0.0..=1.0 animation value driven either by a duration + Curve or by a Spring fling.
AnyView
A type-erased View: lets a piece of UI change its concrete view type between frames (e.g. a conditional if cond { text(..) } else { button(..) }) while still fitting the statically-typed rebuild machinery.
App
A Frust application: the app state plus the build closure that maps it to a view tree.
BackHandler
Android back-press ⇄ navigator auto-wiring: attach_back_handler/BackHandler pop a NavigatorController on a platform back press and keep frust-reactive‘s handles_back flag in sync with the stack depth, so a shell knows whether a root-level back should fall through to the platform (activity finish). Mirrors RouterDeepLinks’s shape and, like it, is the ONLY place in the facade that sees both frust-widgets’ NavigatorController and frust-reactive’s back-press source together — see BackHandler’s doc for the consume/dedupe and timing contracts. Call BackHandler::track from every Component::build. Android back-press ⇄ navigator auto-wiring: attach_back_handler/BackHandler pop a NavigatorController on a platform back press and keep frust-reactive‘s handles_back flag in sync with the stack depth, so a shell knows whether a root-level back should fall through to the platform (activity finish). Mirrors RouterDeepLinks’s shape and, like it, is the ONLY place in the facade that sees both frust-widgets’ NavigatorController and frust-reactive’s back-press source together — see BackHandler’s doc for the consume/dedupe and timing contracts. Call BackHandler::track from every Component::build. Android back-press ⇄ navigator auto-wiring: attach_back_handler/BackHandler pop a NavigatorController on a platform back press and keep frust-reactive‘s handles_back flag in sync with the stack depth, so a shell knows whether a root-level back should fall through to the platform (activity finish). Mirrors RouterDeepLinks’s shape and, like it, is the ONLY place in the facade that sees both frust-widgets’ NavigatorController and frust-reactive’s back-press source together — see BackHandler’s doc for the consume/dedupe and timing contracts. Call BackHandler::track from every Component::build. A NavigatorController wired to the process-wide back-press source (see the module docs) — the explicit back-wiring surface predating the automatic navigator auto-wiring.
BackPresses
The Android back-press source (frust-reactive’s process-wide back source — see its back module docs). A mobile shell delivers a hardware/gesture back press via push_back_press, and the facade’s BackHandler reads it via back_presses to pop a navigator; set_handles_back/handles_back are the “framework consumes the next back” flag a shell polls to decide whether a root-level back falls through to the platform. App code normally uses attach_back_handler rather than these directly; push_back_press is also the desktop dev seam (no shell writes on desktop yet). The app-facing back-press read surface (see the module docs). Obtained via back_presses (frust::back_presses() at the facade).
Bouncing
iOS’s scroll feel — Flutter’s BouncingScrollPhysics: a drag may pull the position past an edge against a friction factor that tightens with depth, nothing is ever boundary-rejected, and a release runs an exponential friction curve that hands over to a rubber-band spring at whichever edge it reaches.
ButtonView
A declarative pressable button. See the module docs.
CanvasView
Declarative custom painting over the [PaintScene] trait object — a chart, a node-and-edge graph, a game board — without hand-rolling a View/ Widget pair. canvas takes a paint closure that runs in local space (the widget’s own top-left is always (0, 0), and painting past its own size is clipped, never a bug to chase) — flat-re-exported from frust-widgets so app code never names that crate directly. See CanvasView’s own doc for the full builder contract (.size/.expand sizing, .on_hit-gated .on_tap/.on_pointer, and .repaint_key for paint-only dirtying driven by data outside the ordinary View diff).
CanvasWidget
Declarative custom painting over the [PaintScene] trait object — a chart, a node-and-edge graph, a game board — without hand-rolling a View/ Widget pair. canvas takes a paint closure that runs in local space (the widget’s own top-left is always (0, 0), and painting past its own size is clipped, never a bug to chase) — flat-re-exported from frust-widgets so app code never names that crate directly. See CanvasView’s own doc for the full builder contract (.size/.expand sizing, .on_hit-gated .on_tap/.on_pointer, and .repaint_key for paint-only dirtying driven by data outside the ordinary View diff).
CheckboxView
A declarative checkbox. See the module docs.
ChildKey
A stable identity for a list child, so a container’s reconciliation can match a child to its live widget by key across reorders/inserts instead of by position — the difference between “the third row’s widget” and “row #42’s widget” when the list is shuffled.
Clamping
Android’s scroll feel — Flutter’s ClampingScrollPhysics: a drag never leaves the range (the excess is rejected outright, for the surface to show as a stretch or a glow instead), and a release runs Android’s own SplineOverScroller deceleration to a hard stop.
ColorScheme
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
ComponentView
The View adapter that hosts a Component in any surrounding view tree.
ContainerView
A declarative decorated box. See the module docs.
ContainerWidget
The retained widget for a ContainerView. See the module docs.
CosmeticLoopRate
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
DeepLink
The deep-link read surface (frust-reactive’s app_links- style process-wide source — see its module docs for the semantics): a mobile shell delivers a platform link via frust-reactive’s push_deep_link, and app code reads it here — deep_links() returns a DeepLinks snapshot (DeepLinks::initial) plus the live, trackable DeepLinks::latest signal a Component::build reads to react to cold-start and subsequent links uniformly. Router auto-wiring (resolving deep_links() against a Router) is a separate opt-in, not automatic here.
DeepLinks
The deep-link read surface (frust-reactive’s app_links- style process-wide source — see its module docs for the semantics): a mobile shell delivers a platform link via frust-reactive’s push_deep_link, and app code reads it here — deep_links() returns a DeepLinks snapshot (DeepLinks::initial) plus the live, trackable DeepLinks::latest signal a Component::build reads to react to cold-start and subsequent links uniformly. Router auto-wiring (resolving deep_links() against a Router) is a separate opt-in, not automatic here.
DesktopConfig
The desktop app’s identity and native-integration vocabulary, re-exported from the desktop core so app code never names a shell crate: DesktopConfig (the whole declaration — app name, reverse-DNS id, window icon, menu bar, last-window-close policy — handed to App::desktop, run_desktop_config or app!’s desktop = { .. } argument), MenuSpec/MenuItemSpec/MenuRole (the platform-independent native menu tree a per-OS shell translates into an NSApp menu bar or an HMENU), DesktopIconData (decoded, tightly-packed RGBA8 — decoding a PNG/ICO/ICNS is the caller’s job), and DEFAULT_APP_NAME (the window title a config that names nothing still gets).
DesktopIconData
The desktop app’s identity and native-integration vocabulary, re-exported from the desktop core so app code never names a shell crate: DesktopConfig (the whole declaration — app name, reverse-DNS id, window icon, menu bar, last-window-close policy — handed to App::desktop, run_desktop_config or app!’s desktop = { .. } argument), MenuSpec/MenuItemSpec/MenuRole (the platform-independent native menu tree a per-OS shell translates into an NSApp menu bar or an HMENU), DesktopIconData (decoded, tightly-packed RGBA8 — decoding a PNG/ICO/ICNS is the caller’s job), and DEFAULT_APP_NAME (the window title a config that names nothing still gets).
DividerView
A declarative hairline separator. See the module docs.
DividerWidget
The retained widget for a DividerView. See the module docs.
EasingSet
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
EdgeInsets
Per-edge inset amounts, in logical pixels.
Elevation
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
ElevationLevel
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
FlexChild
One child of a FlexView: an erased child view, its flex factor (0 = inflexible; > 0 = takes a proportional share of the free main space), and an optional ChildKey for keyed reconciliation.
FlexView
A declarative flex container. See the module docs.
FontFace
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
FrameTime
The animation vocabulary: the shell-fed frame clock (FrameTime) plus the pure easing/interpolation/spring math a widget or app advances it through, flat-re-exported from frust-core::anim. Time enters from the shell during paint (PaintCtx::frame_time); nothing here reads a clock. A point in time supplied by the shell, in monotonic nanoseconds.
GestureDetectorView
A declarative gesture wrapper. See the module docs.
GlassFill
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
GlassMaterial
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
GlassScale
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
HeroView
A declarative shared-element wrapper. See the module docs.
IconButtonView
A declarative pressable vector icon. See the module docs.
IconData
A cheap-clone handle around an icon’s path data and its design box.
IconSource
A generated icon: SVG path d data plus the side length of its square design box.
IconView
A declarative icon. See the module docs.
IconWidget
The retained widget for an IconView.
ImageError
Error decoding image bytes via ImageSource::decode.
ImageSource
A decode-once, cheaply-clonable handle around a decoded RGBA8 image.
ImageView
A declarative description of an image.
ListView
A declarative, virtualized vertical list. See the module docs.
ListViewWidget
The retained widget for a ListView: the materialized window of children (children[j] renders item keys[j]), the scroll offset + cached viewport, and the same fling bookkeeping as crate::ScrollWidget.
Location
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
Memo
A memo is an efficient derived reactive value based on other reactive values.
MenuEvent
The menu-activation read surface (frust-reactive’s process-wide menu source — see its module docs): a per-OS desktop shell drains its native menu queue once per frame and reports each activation, and app code observes it here. menu_events() returns the live MenuEvents handle whose latest signal carries a MenuEvent — the activated item’s id exactly as the app wrote it in its MenuSpec, plus a monotonic sequence so choosing the same item twice reads as two activations rather than one stale value.
MenuEvents
The menu-activation read surface (frust-reactive’s process-wide menu source — see its module docs): a per-OS desktop shell drains its native menu queue once per frame and reports each activation, and app code observes it here. menu_events() returns the live MenuEvents handle whose latest signal carries a MenuEvent — the activated item’s id exactly as the app wrote it in its MenuSpec, plus a monotonic sequence so choosing the same item twice reads as two activations rather than one stale value.
MenuSpec
The desktop app’s identity and native-integration vocabulary, re-exported from the desktop core so app code never names a shell crate: DesktopConfig (the whole declaration — app name, reverse-DNS id, window icon, menu bar, last-window-close policy — handed to App::desktop, run_desktop_config or app!’s desktop = { .. } argument), MenuSpec/MenuItemSpec/MenuRole (the platform-independent native menu tree a per-OS shell translates into an NSApp menu bar or an HMENU), DesktopIconData (decoded, tightly-packed RGBA8 — decoding a PNG/ICO/ICNS is the caller’s job), and DEFAULT_APP_NAME (the window title a config that names nothing still gets).
MotionDurations
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
MotionScheme
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
MotionSpring
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
NativeTypefaces
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
NavigatorController
The app-state handle to a navigator: a cloneable op queue an app keeps in its Component::State and drives with push/pop/ replace. Every clone shares one queue (Rc), so the handle the view carries and the handle event handlers call are the same.
NavigatorId
An opaque identity for the navigator a NavigatorController drives: every clone of one controller reports the same value, and two independently constructed controllers never do.
NavigatorView
A declarative navigator. See the module docs.
NeverScrollable
Flutter’s NeverScrollableScrollPhysics: refuse every drag, deferring everything else to the chained parent — an inner list inside an outer scroller, or a temporarily locked surface.
OverlayPlacement
A resolved placement request: which side, how it lines up, how far off the anchor it sits, and how it may move to stay inside the area.
OverlayPortalView
A declarative overlay portal. See overlay_portal.
PaddingView
A declarative padding container. See the module docs.
PanZoomController
A pan/zoom viewport over one child — a node-and-edge graph, a map, a large image — without hand-rolling the gesture math. pan_zoom lays its child out at its natural size and places it under a scale-then-translate transform (PanZoomTransform) the user drives: primary drag pans (unless the child claims the press), a touch pinch or a desktop ctrl/⌘+wheel and trackpad pinch zooms about the gesture’s focal point, clamped to .min_scale/.max_scale. A plain wheel still reaches the child, and the child sees its own unscaled local coordinates at any zoom. Flat-re-exported from frust-widgets so app code never names that crate directly; see PanZoomView’s own doc for the full contract (.inertia glide, .on_transform notification, and the PanZoomController handle’s jump_to/fit_to_bounds/fit_rect).
PanZoomTransform
A pan/zoom viewport over one child — a node-and-edge graph, a map, a large image — without hand-rolling the gesture math. pan_zoom lays its child out at its natural size and places it under a scale-then-translate transform (PanZoomTransform) the user drives: primary drag pans (unless the child claims the press), a touch pinch or a desktop ctrl/⌘+wheel and trackpad pinch zooms about the gesture’s focal point, clamped to .min_scale/.max_scale. A plain wheel still reaches the child, and the child sees its own unscaled local coordinates at any zoom. Flat-re-exported from frust-widgets so app code never names that crate directly; see PanZoomView’s own doc for the full contract (.inertia glide, .on_transform notification, and the PanZoomController handle’s jump_to/fit_to_bounds/fit_rect).
PanZoomView
A pan/zoom viewport over one child — a node-and-edge graph, a map, a large image — without hand-rolling the gesture math. pan_zoom lays its child out at its natural size and places it under a scale-then-translate transform (PanZoomTransform) the user drives: primary drag pans (unless the child claims the press), a touch pinch or a desktop ctrl/⌘+wheel and trackpad pinch zooms about the gesture’s focal point, clamped to .min_scale/.max_scale. A plain wheel still reaches the child, and the child sees its own unscaled local coordinates at any zoom. Flat-re-exported from frust-widgets so app code never names that crate directly; see PanZoomView’s own doc for the full contract (.inertia glide, .on_transform notification, and the PanZoomController handle’s jump_to/fit_to_bounds/fit_rect).
PanZoomWidget
A pan/zoom viewport over one child — a node-and-edge graph, a map, a large image — without hand-rolling the gesture math. pan_zoom lays its child out at its natural size and places it under a scale-then-translate transform (PanZoomTransform) the user drives: primary drag pans (unless the child claims the press), a touch pinch or a desktop ctrl/⌘+wheel and trackpad pinch zooms about the gesture’s focal point, clamped to .min_scale/.max_scale. A plain wheel still reaches the child, and the child sees its own unscaled local coordinates at any zoom. Flat-re-exported from frust-widgets so app code never names that crate directly; see PanZoomView’s own doc for the full contract (.inertia glide, .on_transform notification, and the PanZoomController handle’s jump_to/fit_to_bounds/fit_rect).
PathPattern
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
PlatformViewView
Platform-view embedding (platform-views feature): reserve layout space for a native view (a map, a video player, …) composited alongside the frust surface. platform_view takes the "dev.frust.<Factory>"-style native factory name registered on each platform and returns a builder (PlatformViewView) over the params/size contract — flat-re-exported from frust-widgets so app code never names that crate directly.
PopResult
The value a pop hands back to the pusher’s ResultCallback, type-erased so a page can return any 'static payload (mirroring Flutter’s Navigator.pop(result) → push(...).then(...)).
PushOptions
Options for NavigatorController::push_with_options, carrying a pushed page’s opacity, back-press BackPolicy, optional per-op transition override, optional result callback, and (for a DismissAnimated overlay) the shared dismiss-signal cell the navigator bumps on a back request.
RadioView
A declarative radio button. See the module docs.
RadioWidget
The retained widget for a RadioView.
ReadSignal
An arena-allocated getter for a reactive signal.
ResolvedPage
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
Route
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
RouteNavigator
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
RouteObserver
The reactive route-state observable: RouteObserver is the signal face over frust_widgets’ signal-free RouteStack/NavChange — the counterpart to RouteNavigator (intent, queued requests) that reads fact (the last-published stack) instead. Construct once (typically in Component::init) and attach with observe(navigator(...)); RouterDeepLinks::routes hands out the one it wired for a router-driven navigator. See route_state’s module docs for why this bridge lives in the facade rather than frust-widgets. Reactive face of one navigator’s route stack: Copy + Send + Sync (five RwSignals and nothing else), so it rides provide_context — the navigator’s own NavigatorController/ Router never can (see frust_widgets::nav::route’s module docs for why).
RouteStack
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
Router
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
RouterDeepLinks
Router ⇄ deep-link auto-wiring: router_with_deep_links/ RouterDeepLinks resolve a Router’s start location from the process’s cold-start deep link (falling back to an app-supplied default) and keep navigating it on every subsequent warm link — see RouterDeepLinks’s doc for the precedence and dedupe contracts. This is the ONLY place in the facade that sees both frust-widgets’ Router and frust-reactive‘s deep-link source together; neither underlying crate depends on the other. Router ⇄ deep-link auto-wiring: router_with_deep_links/ RouterDeepLinks resolve a Router’s start location from the process’s cold-start deep link (falling back to an app-supplied default) and keep navigating it on every subsequent warm link — see RouterDeepLinks’s doc for the precedence and dedupe contracts. This is the ONLY place in the facade that sees both frust-widgets’ Router and frust-reactive‘s deep-link source together; neither underlying crate depends on the other. Router ⇄ deep-link auto-wiring: router_with_deep_links/ RouterDeepLinks resolve a Router’s start location from the process’s cold-start deep link (falling back to an app-supplied default) and keep navigating it on every subsequent warm link — see RouterDeepLinks’s doc for the precedence and dedupe contracts. This is the ONLY place in the facade that sees both frust-widgets’ Router and frust-reactive’s deep-link source together; neither underlying crate depends on the other. A Router wired to the process-wide deep-link source (see the module docs). Construct once with router_with_deep_links (or RouterDeepLinks::new directly) — typically from Component::init, storing the result in Component::State — then call track from every Component::build to keep navigating on subsequent warm links.
RubberBand
The iOS-style rubber-band scroll feel: a drag may pull the position past an edge, resisted by [OVERSCROLL_RESISTANCE], and nothing about a boundary is rejected. See the module docs for what the trait does not carry for this physics.
RwSignal
The reactive-programming vocabulary Component state is built on: signals, memos, and context, flat-re-exported from frust-reactive/ reactive_graph so app authors never name either crate directly. An arena-allocated signal that can be read from or written to.
SafeAreaView
A declarative safe-area container. See the module docs.
ScaffoldView
A declarative scaffold. See the module docs.
ScrollInfo
A scroll observation snapshot handed to ScrollView::on_scroll.
ScrollMetrics
A read-only snapshot of a scroll surface’s extent/position, the argument every ScrollPhysics method reasons over (Flutter’s ScrollMetrics).
ScrollView
A declarative vertical scroll surface. See the module docs.
SelectionToolbarActions
The selection-toolbar seam: the request a text field publishes when it has a selection (SelectionToolbarRequest/SelectionToolbarActions), and the knobs that decide who draws it.
SelectionToolbarRequest
The selection-toolbar seam: the request a text field publishes when it has a selection (SelectionToolbarRequest/SelectionToolbarActions), and the knobs that decide who draws it.
ShadowSpec
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
ShapeScale
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
ShieldView
Platform-view embedding (platform-views feature): reserve layout space for a native view (a map, a video player, …) composited alongside the frust surface. platform_view takes the "dev.frust.<Factory>"-style native factory name registered on each platform and returns a builder (PlatformViewView) over the params/size contract — flat-re-exported from frust-widgets so app code never names that crate directly.
SizedBoxView
A declarative fixed-size box, optionally wrapping a child. See the module docs.
SliderView
A declarative slider. See the module docs.
Spring
The animation vocabulary: the shell-fed frame clock (FrameTime) plus the pure easing/interpolation/spring math a widget or app advances it through, flat-re-exported from frust-core::anim. Time enters from the shell during paint (PaintCtx::frame_time); nothing here reads a clock. The analytic response of a SpringDesc released from an initial displacement + velocity toward equilibrium at 0.
SpringDesc
The animation vocabulary: the shell-fed frame clock (FrameTime) plus the pure easing/interpolation/spring math a widget or app advances it through, flat-re-exported from frust-core::anim. Time enters from the shell during paint (PaintCtx::frame_time); nothing here reads a clock. Physical parameters of a damped spring (a mass on a spring with a damper).
SpringDescription
A critically-damped-family spring’s physical parameters, feeding a Simulation built from ScrollPhysics::spring (Flutter’s SpringDescription).
StackView
A declarative z-ordered stack. See the module docs.
StatusColors
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
StatusPalette
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
TextInputView
A declarative text field, single-line by default. See the module docs.
TextView
A declarative description of a run of text.
Theme
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
ThemeBuilder
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
ThemeExtensions
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
Tolerance
The velocity/distance thresholds below which a ballistic simulation is considered settled — Flutter’s Tolerance, produced by toleranceFor.
TransitionSpec
A transition selection: which PageTransition shape, driven by which Timing. Attached per-push/replace (or defaulted at the navigator level); a pop reverses the popped page’s stored spec.
TransitionState
A snapshot of the navigator’s single in-flight page transition, published by NavigatorWidget and read through NavigatorController::transition.
Tween
The animation vocabulary: the shell-fed frame clock (FrameTime) plus the pure easing/interpolation/spring math a widget or app advances it through, flat-re-exported from frust-core::anim. Time enters from the shell during paint (PaintCtx::frame_time); nothing here reads a clock. A begin→end interpolation over a Lerp value type.
TypeScale
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
UseTask
The heavy-work idiom: AsyncValue state, use_task (the blessed load/compute helper), UseTask handle, and spawn_blocking (the CPU-bound entry point) — Frust’s counterpart to Flutter’s compute()/FutureBuilder, with explicit cancellation on component teardown. spawn_blocking joins the existing spawn/spawn_local routing pair (async IO / UI-thread !Send / one-off CPU work). App crates need no new dependency: this is the whole heavy-work surface. See frust_reactive::task for the threading contract. The handle use_task returns: a read handle to the task’s AsyncValue<T> state plus a restart/refresh trigger.
WindowMetrics
The window’s shape, flat-re-exported from frust-core::app so app code (not just widget authors, see authoring::WindowMetrics) can recover it via use_context::<WindowMetrics>() inside Component::build — a component laying itself out around window size/scale/orientation reads this the same way it reads a Theme via use_context. Delivered as a plain value (not an RwSignal); see WindowMetrics’s own doc for the derived-Orientation and rebuild-cost notes. The window’s shape and platform-occlusion state, delivered to app code as a plain provide_context-carried value — logical size, device-pixel scale, a derived orientation, and the current WindowInsets.
WriteSignal
An arena-allocated setter for a reactive signal.

Enums§

AnimationStatus
The animation vocabulary: the shell-fed frame clock (FrameTime) plus the pure easing/interpolation/spring math a widget or app advances it through, flat-re-exported from frust-core::anim. Time enters from the shell during paint (PaintCtx::frame_time); nothing here reads a clock. The lifecycle status of an AnimationController.
AsyncValue
The heavy-work idiom: AsyncValue state, use_task (the blessed load/compute helper), UseTask handle, and spawn_blocking (the CPU-bound entry point) — Frust’s counterpart to Flutter’s compute()/FutureBuilder, with explicit cancellation on component teardown. spawn_blocking joins the existing spawn/spawn_local routing pair (async IO / UI-thread !Send / one-off CPU work). App crates need no new dependency: this is the whole heavy-work surface. See frust_reactive::task for the threading contract. The exhaustive state of an asynchronously-loaded value.
Axis
The axis a FlexView lays its children along.
BackPolicy
How a page participates in a back press routed through NavigatorController::request_back (Android hardware/gesture back, via the facade’s back-press wiring). A page declares its policy when pushed via PushOptions::back; every existing push defaults to Pop.
BorderStyle
A border’s stroke style, set via ContainerView::border_style. Solid by default; ContainerView::border alone (with no .border_style call) keeps the pre-existing solid-only behavior unchanged.
Brightness
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
ButtonStyle
Visual style variant for Button. Additive: the default preserves today’s only look byte-for-byte under every theme. See the module docs for the full role-mapping intent.
CrossAxisAlignment
How children are aligned along the cross axis.
CursorIcon
The pointer-cursor vocabulary, flat-re-exported from frust-core::event (and also available through authoring::CursorIcon).
Curve
The animation vocabulary: the shell-fed frame clock (FrameTime) plus the pure easing/interpolation/spring math a widget or app advances it through, flat-re-exported from frust-core::anim. Time enters from the shell during paint (PaintCtx::frame_time); nothing here reads a clock. An easing curve mapping a normalized time t ∈ [0, 1] to an eased progress ∈ [0, 1].
DecelerationRate
How quickly a Bouncing surface’s fling decays — Flutter’s ScrollDecelerationRate.
DesignLanguage
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
EditCommand
The clipboard/selection command vocabulary, flat-re-exported from frust-core::event (and also available through authoring::EditCommand).
ImageDecodeError
Off-thread image decode: decode_image_async wraps the existing synchronous ImageSource::decode in spawn_blocking, so it composes with use_task for the full load/error/ready idiom without ever blocking the UI thread on a decode. See image_async’s module docs for why this lives in the facade rather than frust-widgets (which stays reactive-free by charter) and for the Arc-move contract the decoded ImageSource crosses threads under. Off-thread image decode: decode_image_async wraps the existing synchronous ImageSource::decode in spawn_blocking, so it composes with use_task for the full load/error/ready idiom without ever blocking the UI thread on a decode. See image_async’s module docs for why this lives in the facade rather than frust-widgets (which stays reactive-free by charter) and for the Arc-move contract the decoded ImageSource crosses threads under. Off-thread image decode: decode_image_async wraps the existing synchronous ImageSource::decode in spawn_blocking, so it composes with use_task for the full load/error/ready idiom without ever blocking the UI thread on a decode. See image_async’s module docs for why this lives in the facade rather than frust-widgets (which stays reactive-free by charter) and for the Arc-move contract the decoded ImageSource crosses threads under. The error decode_image_async can fail with.
ImageFit
How an Image’s laid-out box relates to its source’s natural pixel size at paint time.
MainAxisAlignment
How children are distributed along the main axis.
MenuItemSpec
The desktop app’s identity and native-integration vocabulary, re-exported from the desktop core so app code never names a shell crate: DesktopConfig (the whole declaration — app name, reverse-DNS id, window icon, menu bar, last-window-close policy — handed to App::desktop, run_desktop_config or app!’s desktop = { .. } argument), MenuSpec/MenuItemSpec/MenuRole (the platform-independent native menu tree a per-OS shell translates into an NSApp menu bar or an HMENU), DesktopIconData (decoded, tightly-packed RGBA8 — decoding a PNG/ICO/ICNS is the caller’s job), and DEFAULT_APP_NAME (the window title a config that names nothing still gets).
MenuRole
The desktop app’s identity and native-integration vocabulary, re-exported from the desktop core so app code never names a shell crate: DesktopConfig (the whole declaration — app name, reverse-DNS id, window icon, menu bar, last-window-close policy — handed to App::desktop, run_desktop_config or app!’s desktop = { .. } argument), MenuSpec/MenuItemSpec/MenuRole (the platform-independent native menu tree a per-OS shell translates into an NSApp menu bar or an HMENU), DesktopIconData (decoded, tightly-packed RGBA8 — decoding a PNG/ICO/ICNS is the caller’s job), and DEFAULT_APP_NAME (the window title a config that names nothing still gets).
NavChange
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
NavRequest
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
Orientation
The window’s shape, flat-re-exported from frust-core::app so app code (not just widget authors, see authoring::WindowMetrics) can recover it via use_context::<WindowMetrics>() inside Component::build — a component laying itself out around window size/scale/orientation reads this the same way it reads a Theme via use_context. Delivered as a plain value (not an RwSignal); see WindowMetrics’s own doc for the derived-Orientation and rebuild-cost notes. A window’s derived portrait/landscape orientation.
OutsideTap
The overlay portal’s own vocabulary, flat-re-exported from frust-core: which z-band a floated surface sits in, whether the pointer reaches it, and what a press landing outside it delivers.
OverlayAlign
How a floated surface lines up with its anchor on the cross axis.
OverlayBand
The overlay portal’s own vocabulary, flat-re-exported from frust-core: which z-band a floated surface sits in, whether the pointer reaches it, and what a press landing outside it delivers.
OverlayInput
The overlay portal’s own vocabulary, flat-re-exported from frust-core: which z-band a floated surface sits in, whether the pointer reaches it, and what a press landing outside it delivers.
OverlaySide
The side of the anchor a floated surface opens on.
OverscrollEffect
How overscroll displacement/pull is VISUALIZED — orthogonal to physics.
PageTransition
The visual shape of a page transition. The navigator maps the active transition’s progress onto per-page geometry through resolve_layers.
PageVisibility
Where a retained page sits in the stack right now — the vocabulary PushOptions::on_visibility/NavigatorView::on_root_visibility report.
Resolution
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
ResolvedSurfaceMode
App-facing resolved surface mode — the read-only outward half of the Mode B seam whose setter is deliberately absent (see the comment above): what the platform actually gave this process, not what the host asked for.
SelectionToolbarPolicy
The selection-toolbar seam: the request a text field publishes when it has a selection (SelectionToolbarRequest/SelectionToolbarActions), and the knobs that decide who draws it.
SurfaceRole
The design-token vocabulary: the Theme bundle plus its component token tables, flat-re-exported from frust-theme so app code never names that crate directly. A root component reads the active theme via use_context::<Theme>(); a widget reads it during paint/layout via PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
SystemUiMode
App-facing system-UI (system-bar) override: set_system_ui_mode requests a status-/navigation-bar visibility mode — the Flutter SystemChrome.setEnabledSystemUIMode analog — reaching whichever shell is running the next time it polls (once per frame, mirroring set_app_theme’s delivery timing). See frust_shell_common::system_ui’s module docs for the full layering rationale, the thread contract (a plain Mutex-guarded process-global, callable from any thread), the FFI wire format each mobile shell exports, and where Android/iOS diverge from the five-mode vocabulary.
SystemUiOverlay
App-facing system-UI (system-bar) override: set_system_ui_mode requests a status-/navigation-bar visibility mode — the Flutter SystemChrome.setEnabledSystemUIMode analog — reaching whichever shell is running the next time it polls (once per frame, mirroring set_app_theme’s delivery timing). See frust_shell_common::system_ui’s module docs for the full layering rationale, the thread contract (a plain Mutex-guarded process-global, callable from any thread), the FFI wire format each mobile shell exports, and where Android/iOS diverge from the five-mode vocabulary.
Timing
How a transition’s 0.0..=1.0 progress is driven.
TransitionDriver
The page-transition resolve/drive path: the framework’s own reduce- motion collapse policy, re-exported so an app-authored animation reuses it rather than re-deriving it.

Constants§

DEFAULT_APP_NAME
The desktop app’s identity and native-integration vocabulary, re-exported from the desktop core so app code never names a shell crate: DesktopConfig (the whole declaration — app name, reverse-DNS id, window icon, menu bar, last-window-close policy — handed to App::desktop, run_desktop_config or app!’s desktop = { .. } argument), MenuSpec/MenuItemSpec/MenuRole (the platform-independent native menu tree a per-OS shell translates into an NSApp menu bar or an HMENU), DesktopIconData (decoded, tightly-packed RGBA8 — decoding a PNG/ICO/ICNS is the caller’s job), and DEFAULT_APP_NAME (the window title a config that names nothing still gets).
DEFAULT_REDIRECT_LIMIT
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
MAX_FLING_VELOCITY
The fastest fling speed (px/s) a physics honors — Flutter’s kMaxFlingVelocity. A release faster than this clamps to it.
MIN_FLING_VELOCITY
The minimum release speed (px/s) that starts a fling — Flutter’s kMinFlingVelocity. A release slower than this is treated as a plain drag-end, never a fling.

Traits§

Component
A piece of UI with retained local state (Flutter’s StatefulWidget analog).
Get
Clones the value of the signal, without tracking the value reactively. and subscribes the active reactive observer (an effect or computed) to changes in its value.
GetUntracked
Clones the value of the signal, without tracking the value reactively.
Lerp
The animation vocabulary: the shell-fed frame clock (FrameTime) plus the pure easing/interpolation/spring math a widget or app advances it through, flat-re-exported from frust-core::anim. Time enters from the shell during paint (PaintCtx::frame_time); nothing here reads a clock. Component-wise linear interpolation between two values of the same type.
ScrollPhysics
A pluggable scroll-motion strategy — Flutter’s ScrollPhysics contract.
Set
Updates the value of the signal by replacing it.
Simulation
A ballistic motion curve over time, produced by ScrollPhysics::create_ballistic_simulation and driven by the consuming widget after a gesture release (fling decay, a spring-back, or any other closed-form or iterative curve).
Track
Allows tracking the value of some reactive data.
Update
Updates the value of a signal by applying a function that updates it in place, notifying its subscribers that the value has changed.
View
A declarative description of a piece of UI.
With
Give read-only access to a signal’s value by reference inside a closure, and subscribes the active reactive observer (an effect or computed) to changes in its value.
WithUntracked
Give read-only access to a signal’s value by reference inside a closure, without tracking the value reactively.

Functions§

Align
Position child within the align’s box per alignment.
Button
PascalCase alias for button, matching the container view-fn vocabulary.
Checkbox
PascalCase alias for checkbox.
Column
A vertical flex (Axis::Vertical) of inflexible children — the common sugar. Use FlexView::new with flexible children when some should expand.
GestureDetector
Wrap child in a gesture detector (no recognisers until one is attached, e.g. with GestureDetectorView::on_tap or GestureDetectorView::on_long_press).
Icon
PascalCase alias for icon.
IconButton
PascalCase alias for icon_button, matching the container view-fn vocabulary (see crate::Icon/crate::Button’s own aliases).
Image
Create an image view over a decoded ImageSource, defaulting to ImageFit::Contain.
Padding
Inset child by insets on each edge.
Radio
PascalCase alias for radio.
Row
A horizontal flex (Axis::Horizontal) of inflexible children — the common sugar. Use FlexView::new with flexible children when some should expand.
SizedBox
A box that forces width/height where Some, passing through where None.
Slider
PascalCase alias for slider.
Stack
Overlay children in a z-order stack (first child at the bottom).
TextInput
PascalCase alias for text_input.
any
Erase view into an AnyView — the free-function spelling of AnyView::new, mirroring the text(..)/button(..) view-fn vocabulary.
attach_back_handler
Android back-press ⇄ navigator auto-wiring: attach_back_handler/BackHandler pop a NavigatorController on a platform back press and keep frust-reactive‘s handles_back flag in sync with the stack depth, so a shell knows whether a root-level back should fall through to the platform (activity finish). Mirrors RouterDeepLinks’s shape and, like it, is the ONLY place in the facade that sees both frust-widgets’ NavigatorController and frust-reactive’s back-press source together — see BackHandler’s doc for the consume/dedupe and timing contracts. Call BackHandler::track from every Component::build. Android back-press ⇄ navigator auto-wiring: attach_back_handler/BackHandler pop a NavigatorController on a platform back press and keep frust-reactive‘s handles_back flag in sync with the stack depth, so a shell knows whether a root-level back should fall through to the platform (activity finish). Mirrors RouterDeepLinks’s shape and, like it, is the ONLY place in the facade that sees both frust-widgets’ NavigatorController and frust-reactive’s back-press source together — see BackHandler’s doc for the consume/dedupe and timing contracts. Call BackHandler::track from every Component::build. Android back-press ⇄ navigator auto-wiring: attach_back_handler/BackHandler pop a NavigatorController on a platform back press and keep frust-reactive‘s handles_back flag in sync with the stack depth, so a shell knows whether a root-level back should fall through to the platform (activity finish). Mirrors RouterDeepLinks’s shape and, like it, is the ONLY place in the facade that sees both frust-widgets’ NavigatorController and frust-reactive’s back-press source together — see BackHandler’s doc for the consume/dedupe and timing contracts. Call BackHandler::track from every Component::build. Convenience constructor equivalent to BackHandler::new — see its docs and RouterDeepLinks/router_with_deep_links for the mirrored API shape.
back_presses
The Android back-press source (frust-reactive’s process-wide back source — see its back module docs). A mobile shell delivers a hardware/gesture back press via push_back_press, and the facade’s BackHandler reads it via back_presses to pop a navigator; set_handles_back/handles_back are the “framework consumes the next back” flag a shell polls to decide whether a root-level back falls through to the platform. App code normally uses attach_back_handler rather than these directly; push_back_press is also the desktop dev seam (no shell writes on desktop yet). The current back-press read surface: the live BackPresses::count signal. Call from a tracked context (e.g. inside Component::build, via the facade’s BackHandler) to observe subsequent presses as they arrive.
button
Create a button labelled label that runs on_press against the app state when released inside its bounds.
canvas
Declarative custom painting over the [PaintScene] trait object — a chart, a node-and-edge graph, a game board — without hand-rolling a View/ Widget pair. canvas takes a paint closure that runs in local space (the widget’s own top-left is always (0, 0), and painting past its own size is clipped, never a bug to chase) — flat-re-exported from frust-widgets so app code never names that crate directly. See CanvasView’s own doc for the full builder contract (.size/.expand sizing, .on_hit-gated .on_tap/.on_pointer, and .repaint_key for paint-only dirtying driven by data outside the ordinary View diff).
checkbox
Create a checkbox reflecting checked, labelled label, that fires on_toggle(state, !checked) on release inside its bounds.
clear_app_theme
App-facing theme override: set_app_theme forces the app’s active Theme end-to-end — both delivery paths a shell owned exclusively before this (widget paint/layout via RenderRoot::set_theme, and use_context::<Theme>() via provide_context) — reflecting the change the next time the running shell polls (once per frame; desktop before rebuild, mobile at the top of the frame callback). clear_app_theme returns to the platform’s own light/dark-derived default. See frust_shell_common::theme_override’s module docs for the full layering rationale, the thread contract (a plain Mutex-guarded process-global — no UI-thread panic, unlike push_deep_link), and the override-wins-over-appearance rule (an app override, once set, is never overridden back by a live platform dark-mode flip until clear_app_theme runs).
colored_box
A childless ContainerView — the leaf/background family. See the module docs.
component
Host a Component as a View — the view-fn spelling of ComponentView, mirroring the text(..)/button(..) vocabulary.
container
Wrap child in a ContainerView — the single-child wrapper family. See the module docs.
decode_image_async
Off-thread image decode: decode_image_async wraps the existing synchronous ImageSource::decode in spawn_blocking, so it composes with use_task for the full load/error/ready idiom without ever blocking the UI thread on a decode. See image_async’s module docs for why this lives in the facade rather than frust-widgets (which stays reactive-free by charter) and for the Arc-move contract the decoded ImageSource crosses threads under. Off-thread image decode: decode_image_async wraps the existing synchronous ImageSource::decode in spawn_blocking, so it composes with use_task for the full load/error/ready idiom without ever blocking the UI thread on a decode. See image_async’s module docs for why this lives in the facade rather than frust-widgets (which stays reactive-free by charter) and for the Arc-move contract the decoded ImageSource crosses threads under. Off-thread image decode: decode_image_async wraps the existing synchronous ImageSource::decode in spawn_blocking, so it composes with use_task for the full load/error/ready idiom without ever blocking the UI thread on a decode. See image_async’s module docs for why this lives in the facade rather than frust-widgets (which stays reactive-free by charter) and for the Arc-move contract the decoded ImageSource crosses threads under. Decodes PNG/JPEG bytes off the UI thread via frust_reactive::spawn_blocking, returning the same ImageSource ImageSource::decode would build synchronously.
deep_links
The deep-link read surface (frust-reactive’s app_links- style process-wide source — see its module docs for the semantics): a mobile shell delivers a platform link via frust-reactive’s push_deep_link, and app code reads it here — deep_links() returns a DeepLinks snapshot (DeepLinks::initial) plus the live, trackable DeepLinks::latest signal a Component::build reads to react to cold-start and subsequent links uniformly. Router auto-wiring (resolving deep_links() against a Router) is a separate opt-in, not automatic here.
divider
A horizontal hairline of color, [DEFAULT_THICKNESS] (1px) thick, filling the available width. color is a required argument, not defaulted — see the module docs’ “Color: required, no Theme dependency” section.
flexible
A flexible child taking flex proportional shares of the free main-axis space.
handles_back
The Android back-press source (frust-reactive’s process-wide back source — see its back module docs). A mobile shell delivers a hardware/gesture back press via push_back_press, and the facade’s BackHandler reads it via back_presses to pop a navigator; set_handles_back/handles_back are the “framework consumes the next back” flag a shell polls to decide whether a root-level back falls through to the platform. App code normally uses attach_back_handler rather than these directly; push_back_press is also the desktop dev seam (no shell writes on desktop yet). Whether the framework wants to consume the next back press. A shell polls this to decide whether a back press should be routed into the app (true) or fall through to the platform / activity finish (false, the default until glue publishes otherwise — see the module docs).
hero
Tag child as a shared element under tag, so a navigator morphs it between two pages that both carry the same tag during a page transition. Outside a transition this is a transparent wrapper.
icon
Create an icon view over any IconData source (a generated IconSource, or a user path via IconData::from_path), at the default 24.0 logical size with the theme’s on_surface color.
icon_button
Create a pressable vector icon painting mark, labelled label for accessibility, that runs on_press against the app state when released inside its bounds. See the module docs.
inflexible
An inflexible child, sized to its natural main-axis extent.
keyed
An inflexible child tagged with a stable ChildKey, for a list whose items reorder, insert, or delete between frames.
list_view
Create a virtualized ListView — the free-function spelling of ListView::builder.
lock_selection_toolbar_policy
The selection-toolbar seam: the request a text field publishes when it has a selection (SelectionToolbarRequest/SelectionToolbarActions), and the knobs that decide who draws it.
make_driver
The page-transition resolve/drive path: the framework’s own reduce- motion collapse policy, re-exported so an app-authored animation reuses it rather than re-deriving it.
menu_events
The menu-activation read surface (frust-reactive’s process-wide menu source — see its module docs): a per-OS desktop shell drains its native menu queue once per frame and reports each activation, and app code observes it here. menu_events() returns the live MenuEvents handle whose latest signal carries a MenuEvent — the activated item’s id exactly as the app wrote it in its MenuSpec, plus a monotonic sequence so choosing the same item twice reads as two activations rather than one stale value.
navigator
Build a NavigatorView driven by controller — the facade’s back-aware wrapper over frust_widgets::navigator.
on_cleanup
The reactive-programming vocabulary Component state is built on: signals, memos, and context, flat-re-exported from frust-reactive/ reactive_graph so app authors never name either crate directly. Registers a function to be run the next time the current owner is cleaned up.
overlay_host
Build a root overlay host driven by controller, wrapping the app’s whole root view — the facade’s back-aware wrapper over frust_widgets::overlay_host.
overlay_portal
Float overlay above the whole app, anchored to child’s bounds — the declarative half of the portal.
pan_zoom
A pan/zoom viewport over one child — a node-and-edge graph, a map, a large image — without hand-rolling the gesture math. pan_zoom lays its child out at its natural size and places it under a scale-then-translate transform (PanZoomTransform) the user drives: primary drag pans (unless the child claims the press), a touch pinch or a desktop ctrl/⌘+wheel and trackpad pinch zooms about the gesture’s focal point, clamped to .min_scale/.max_scale. A plain wheel still reaches the child, and the child sees its own unscaled local coordinates at any zoom. Flat-re-exported from frust-widgets so app code never names that crate directly; see PanZoomView’s own doc for the full contract (.inertia glide, .on_transform notification, and the PanZoomController handle’s jump_to/fit_to_bounds/fit_rect).
platform_view
Platform-view embedding (platform-views feature): reserve layout space for a native view (a map, a video player, …) composited alongside the frust surface. platform_view takes the "dev.frust.<Factory>"-style native factory name registered on each platform and returns a builder (PlatformViewView) over the params/size contract — flat-re-exported from frust-widgets so app code never names that crate directly.
provide_context
The reactive-programming vocabulary Component state is built on: signals, memos, and context, flat-re-exported from frust-reactive/ reactive_graph so app authors never name either crate directly. Provides a context value of type T to the current reactive Owner and all of its descendants. This can be accessed using use_context.
push_back_press
The Android back-press source (frust-reactive’s process-wide back source — see its back module docs). A mobile shell delivers a hardware/gesture back press via push_back_press, and the facade’s BackHandler reads it via back_presses to pop a navigator; set_handles_back/handles_back are the “framework consumes the next back” flag a shell polls to decide whether a root-level back falls through to the platform. App code normally uses attach_back_handler rather than these directly; push_back_press is also the desktop dev seam (no shell writes on desktop yet). Deliver a platform back press into the process-wide source. Called by a shell (the Android back callback) on the UI thread; app code never calls this directly.
push_deep_link
The deep-link read surface (frust-reactive’s app_links- style process-wide source — see its module docs for the semantics): a mobile shell delivers a platform link via frust-reactive’s push_deep_link, and app code reads it here — deep_links() returns a DeepLinks snapshot (DeepLinks::initial) plus the live, trackable DeepLinks::latest signal a Component::build reads to react to cold-start and subsequent links uniformly. Router auto-wiring (resolving deep_links() against a Router) is a separate opt-in, not automatic here.
radio
Create a radio reflecting selected, labelled label. Attach a callback with RadioView::on_select; a radio with none is inert (still paints and captures the press, but never fires) — the same optional-callback shape a design system’s own list-item row uses.
register_app_fonts
App-facing pending-font registry: register_app_fonts pushes raw font bytes (TTF/OTF, or a TTC/OTC collection) to be registered into the running shell’s TextContext the next time it drains this registry (construction time, and once per frame – each shell’s own wiring). See frust_shell_common::font_registry’s module docs for the full layering rationale and thread contract (mirrors set_app_theme’s: a plain Mutex-guarded process-global, callable from any thread).
resolve_spec
The page-transition resolve/drive path: the framework’s own reduce- motion collapse policy, re-exported so an app-authored animation reuses it rather than re-deriving it.
resolved_surface_mode
App-facing resolved surface mode — the read-only outward half of the Mode B seam whose setter is deliberately absent (see the comment above): what the platform actually gave this process, not what the host asked for.
router_with_deep_links
Router ⇄ deep-link auto-wiring: router_with_deep_links/ RouterDeepLinks resolve a Router’s start location from the process’s cold-start deep link (falling back to an app-supplied default) and keep navigating it on every subsequent warm link — see RouterDeepLinks’s doc for the precedence and dedupe contracts. This is the ONLY place in the facade that sees both frust-widgets’ Router and frust-reactive‘s deep-link source together; neither underlying crate depends on the other. Router ⇄ deep-link auto-wiring: router_with_deep_links/ RouterDeepLinks resolve a Router’s start location from the process’s cold-start deep link (falling back to an app-supplied default) and keep navigating it on every subsequent warm link — see RouterDeepLinks’s doc for the precedence and dedupe contracts. This is the ONLY place in the facade that sees both frust-widgets’ Router and frust-reactive‘s deep-link source together; neither underlying crate depends on the other. Router ⇄ deep-link auto-wiring: router_with_deep_links/ RouterDeepLinks resolve a Router’s start location from the process’s cold-start deep link (falling back to an app-supplied default) and keep navigating it on every subsequent warm link — see RouterDeepLinks’s doc for the precedence and dedupe contracts. This is the ONLY place in the facade that sees both frust-widgets’ Router and frust-reactive’s deep-link source together; neither underlying crate depends on the other. Convenience constructor equivalent to RouterDeepLinks::new — see its docs for the precedence rule and the call-once contract.
run
Run a root Component in the desktop preview shell until the window closes — the canonical runApp equivalent for the Component model.
run_desktop_config
run with the app’s desktop identity (DesktopConfig) — the no-setup half of the config-carrying pair, and the function app!’s desktop = { .. } argument routes through when no setup = { .. } block accompanies it.
run_with_setup
run with a setup closure run once, immediately before root.init() — the desktop half of app!’s setup = { .. } block.
run_with_setup_and_config
run_with_setup and run_desktop_config at once: the single desktop entry point the other three delegate to, differing only in which of setup and config they default.
safe_area
Pad child by the window’s resolved safe-area insets — all four edges enabled by default (opt an edge out with .left/.top/.right/.bottom), never less than .minimum (zero by default) on an enabled edge. The enabled edges’ insets are consumed: child’s subtree reads zero safe-area padding there (see the module docs).
scaffold
Scaffold body under no chrome — attach app_bar/bottom_bar/fab with the builder methods below.
scroll_view
Wrap child in a vertical ScrollView — the free-function spelling of ScrollView::new.
set_app_theme
App-facing theme override: set_app_theme forces the app’s active Theme end-to-end — both delivery paths a shell owned exclusively before this (widget paint/layout via RenderRoot::set_theme, and use_context::<Theme>() via provide_context) — reflecting the change the next time the running shell polls (once per frame; desktop before rebuild, mobile at the top of the frame callback). clear_app_theme returns to the platform’s own light/dark-derived default. See frust_shell_common::theme_override’s module docs for the full layering rationale, the thread contract (a plain Mutex-guarded process-global — no UI-thread panic, unlike push_deep_link), and the override-wins-over-appearance rule (an app override, once set, is never overridden back by a live platform dark-mode flip until clear_app_theme runs).
set_default_theme
Design-system-facing base-theme seed: set_default_theme supplies the starting theme a shell seeds itself with, in place of its own built-in fallback — the seam a design-system plugin’s install() calls. Unlike set_app_theme, this does NOT pin brightness: the shell keeps re-deriving light/dark from the platform’s own appearance against this same base, so a design-system-themed app installed this way still honours system dark mode. See frust_shell_common::theme_default’s module docs for the full precedence order (set_app_theme override → set_default_theme base → the shell’s built-in fallback) and the brightness-following contrast with set_app_theme spelled out in full.
set_handles_back
The Android back-press source (frust-reactive‘s process-wide back source — see its back module docs). A mobile shell delivers a hardware/gesture back press via push_back_press, and the facade’s BackHandler reads it via back_presses to pop a navigator; set_handles_back/handles_back are the “framework consumes the next back” flag a shell polls to decide whether a root-level back falls through to the platform. App code normally uses attach_back_handler rather than these directly; push_back_press is also the desktop dev seam (no shell writes on desktop yet). Publish whether the framework will consume the next back press (see the module docs’ handles_back section). The facade’s BackHandler calls this each rebuild with controller.can_pop(); a shell reads the answer via handles_back.
set_selection_toolbar_builder
The selection-toolbar seam: the request a text field publishes when it has a selection (SelectionToolbarRequest/SelectionToolbarActions), and the knobs that decide who draws it.
set_selection_toolbar_policy
The selection-toolbar seam: the request a text field publishes when it has a selection (SelectionToolbarRequest/SelectionToolbarActions), and the knobs that decide who draws it.
set_system_ui_mode
App-facing system-UI (system-bar) override: set_system_ui_mode requests a status-/navigation-bar visibility mode — the Flutter SystemChrome.setEnabledSystemUIMode analog — reaching whichever shell is running the next time it polls (once per frame, mirroring set_app_theme’s delivery timing). See frust_shell_common::system_ui’s module docs for the full layering rationale, the thread contract (a plain Mutex-guarded process-global, callable from any thread), the FFI wire format each mobile shell exports, and where Android/iOS diverge from the five-mode vocabulary.
shell_route
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
shield
Platform-view embedding (platform-views feature): reserve layout space for a native view (a map, a video player, …) composited alongside the frust surface. platform_view takes the "dev.frust.<Factory>"-style native factory name registered on each platform and returns a builder (PlatformViewView) over the params/size contract — flat-re-exported from frust-widgets so app code never names that crate directly.
signal
Creates an arena-allocated signal, the basic reactive primitive.
slider
Create a slider at value (clamped to 0.0..=1.0) that fires on_change(state, new_value) as it is dragged.
spawn
Spawns a Send future on the background reactive runtime (Tokio-backed — see frust_reactive::ReactiveRuntime). A thin wrapper over any_spawner::Executor::spawn; app authors never name any_spawner.
spawn_blocking
The heavy-work idiom: AsyncValue state, use_task (the blessed load/compute helper), UseTask handle, and spawn_blocking (the CPU-bound entry point) — Frust’s counterpart to Flutter’s compute()/FutureBuilder, with explicit cancellation on component teardown. spawn_blocking joins the existing spawn/spawn_local routing pair (async IO / UI-thread !Send / one-off CPU work). App crates need no new dependency: this is the whole heavy-work surface. See frust_reactive::task for the threading contract. Runs a one-off, blocking CPU workload on the background runtime’s blocking thread pool, returning a JoinHandle to .await its result.
spawn_local
Spawns a !Send future on the UI-thread local task queue, drained each frame by the shell (ReactiveRuntime::pump_local). A thin wrapper over any_spawner::Executor::spawn_local; must be called on the UI thread — see frust_reactive::ReactiveRuntime::pump_local’s doc for the panic this triggers off-thread.
text
Create a text view rendering content with default styling (16px). Its glyph color defaults to the active theme’s on_surface role, falling back to black when no theme is set; an explicit TextView::color overrides both.
text_input
Create a controlled text field showing value that fires on_change(state, new_text) on every edit.
use_context
The reactive-programming vocabulary Component state is built on: signals, memos, and context, flat-re-exported from frust-reactive/ reactive_graph so app authors never name either crate directly. Extracts a context value of type T from the reactive system.
use_task
The heavy-work idiom: AsyncValue state, use_task (the blessed load/compute helper), UseTask handle, and spawn_blocking (the CPU-bound entry point) — Frust’s counterpart to Flutter’s compute()/FutureBuilder, with explicit cancellation on component teardown. spawn_blocking joins the existing spawn/spawn_local routing pair (async IO / UI-thread !Send / one-off CPU work). App crates need no new dependency: this is the whole heavy-work surface. See frust_reactive::task for the threading contract. Runs a fetch, wiring a heavy-work idiom around it.

Type Aliases§

Color
The color type every ColorScheme role is expressed in (peniko::Color), re-exported so app code can author its own color values (e.g. a custom accent palette that composes onto a baseline ColorScheme) without naming peniko directly — the same facade-only-dependency rule the theme re-exports above follow. Construct one with Color::from_rgb8/Color::new; read its channels via Color::components ([f32; 4], straight-alpha RGBA). A convenient alias for the color type used for Brush.
ErrorBuilder
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
NavWaker
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
PageBuilder
A page builder: a cheap closure that produces the page’s view, re-run every rebuild so a retained page’s content still reconciles against live app state (the pod, and thus the page’s internal widget state, is preserved across the rebuild — only the view descriptor is rebuilt).
Redirect
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
ResultCallback
A pusher-registered result callback: invoked with &mut State when the page it was registered against is popped, carrying the PopResult the pop supplied.
RouteBuilder
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
RouteParams
The declarative router vocabulary (a go_router-subset layer), flat-re-exported from frust-widgets so app code never names that crate directly: Router resolves a location against a Route table (built via RouteBuilder) into Resolution/ResolvedPages driving a NavigatorController, with :param/query parsing (Location/PathPattern/RouteParams), per-route/top-level Redirects (loop-guarded at DEFAULT_REDIRECT_LIMIT), and an ErrorBuilder fallback for an unmatched location.
TaskError
The heavy-work idiom: AsyncValue state, use_task (the blessed load/compute helper), UseTask handle, and spawn_blocking (the CPU-bound entry point) — Frust’s counterpart to Flutter’s compute()/FutureBuilder, with explicit cancellation on component teardown. spawn_blocking joins the existing spawn/spawn_local routing pair (async IO / UI-thread !Send / one-off CPU work). App crates need no new dependency: this is the whole heavy-work surface. See frust_reactive::task for the threading contract. The boxed error an AsyncValue::Error carries. Arc-wrapped so a clone of the state is cheap and the error is shareable across the tree.
VisibilityCallback
A page-visibility observer, registered per page via PushOptions::on_visibility (or NavigatorView::on_root_visibility for the root page). Fired by the navigator from a rebuild whenever the page’s PageVisibility changes — never twice with the same value.