Public API¶
Everything below is importable from the top-level tempestroid package. Always
import from the package level, never from submodules.
Style (tempestroid.style)¶
Frozen Pydantic value objects, diffed by value.
Style— the style model (layout, box, paint, typography, sizing, animation). See the grouped fields in the styles guide.Color—Color.from_hex("#101418").Edge— insets;Edge.all(24.0).Border(uniform) /SideBorder(per-side).Corners— per-corner radii forStyle.radius.Shadow—box-shadow/elevation.Gradient+GradientStop— linear gradient.Transition— implicit animation (duration_ms,curve,delay_ms).- Enums:
FlexDirection,JustifyContent,AlignItems,FlexWrap,StackAlign,Position,TextAlign,FontWeight,FontStyle,TextDecoration,TextOverflow,GradientDirection,Curve,ImageFit,KeyboardType.
See the styles guide.
Widgets (tempestroid.widgets)¶
The declarative IR — bare-noun widgets.
- Layout/content:
Widget(base),Text,Button,Column,Row,Container,ScrollView,SafeArea(insets its child past the status/navigation bars + notch;edges/SafeAreaEdgeselects the sides, default all). Component(base) — a composite widget that lowers to a primitive tree viarender(); the reconciler expands it before diffing.- Value-bearing inputs:
Input(text),TextArea(multiline),Checkbox,Switch(booleans),Slider(float),DatePicker(ISO date),FilePicker(file selection). - Media:
Image,Icon. - Indicators:
ProgressBar,Spinner. EventHandler— typed handler-prop wrapper.
Those are the primitives. On top of them, Track E (Flutter/RN parity) adds
~70 more widgets — navigation (Navigator/TabView/TabBar/
RouteDrawer), virtualized lists (LazyColumn/LazyRow/
LazyGrid/SectionList), overlays (Dialog/BottomSheet/
Menu/Popover/Toast/Tooltip/ActionSheet), animation
(Animated/AnimatedList/Hero/Shimmer/Skeleton),
gestures (GestureDetector/Draggable/Dismissible/
ReorderableList/InteractiveViewer/…), advanced inputs
(Dropdown/TimePicker/RangeSlider/Autocomplete/
PinInput/MaskedInput/Form/FormField), refined layout
(Wrap/PageView/AspectRatio/KeyboardAvoidingView) and media
(Canvas/Svg/VideoPlayer/WebView/Blur/
BackdropFilter/ClipPath plus the device-only CameraPreview/
QrScanner/MapView). All supported by both renderers (except the
device-only ones, which show a placeholder in Qt). The full catalog, by family,
lives in the widgets guide; the live list comes from
tempest spec.
See the widgets guide.
Components (tempestroid.components)¶
Reusable building blocks — each a Component that lowers to primitive
widgets, so they work in both renderers (Qt and Compose) with no renderer changes
and are device-ready. Every component takes an optional style merged over its
default via merge_style.
AppBar— top bar: optionalleading,titleand trailingactions.Header/Footer— header band (title + optional subtitle) and a centered bottom bar holding arbitrarychildren.Sidebar— fixed-widthlateral column ofchildren.Scaffold— page frame stackingapp_bar, a growingbodyand an optionalbottom_bar(scroll=Truewraps the body in aScrollView).NavBar— selectable navigation/tab bar:itemslabels, anactiveindex and anon_select(index)callback (generalises thetabsexample).Burger/Drawer— a hamburger menu button (☰,on_click) and a controlled lateral panel (openlives in app state; toggle it from the burger).Calendar— month grid of selectable day cells:month("YYYY-MM"),selected("YYYY-MM-DD") andon_select(iso_date).Clock— digital clock rendering a preformattedtimestring (the app drives the tick from state, as instopwatch).Card— elevated surface (shadow + radius) groupingchildren.ListTile— list row:leading/trailingwidgets around atitleplus an optionalsubtitle.Avatar— round badge of shortinitials;Divider— thin rule.SegmentedControl/RadioGroup— single-choice pickers (options,selected,on_select(index)).Chip— small rounded label, selectable when given anon_click.Rating— a row ofmax_starsstars;on_rate(value)makes it tappable.Stepper— numeric-/+around a value with optionalmin_value/max_valueclamping;on_change(value).SearchBar— controlled textInputwith an optional clear button.Accordion— controlled expand/collapse section (openin state,on_toggle).Banner— inline status bar (tone: info/success/warning/error) with an optionalaction;Badge— small status pill;EmptyState— centered glyph + title + subtitle + action.Breadcrumb— path trail (items+separator, optionalon_select).Grid— equal-widthcolumnsgrid ofchildren.
Events (tempestroid.widgets) — typed boundary contract¶
Event(base),TapEvent,TextChangeEvent,ToggleEvent,SlideEvent,DateChangeEvent,FileSelectEventplus the Track E events — navigation (RouteChangeEvent/PageChangeEvent), lists (ScrollEvent/EndReachedEvent/RefreshEvent), gestures (PanEvent/ScaleEvent/SwipeEvent/ReorderEvent/LongPressEvent/DragEvent), forms (SubmitEvent/ValidationEvent/RangeChangeEvent/TimeChangeEvent/SelectEvent), overlays (DismissEvent/MenuSelectEvent) and platform (SensorEvent/LifecycleEvent/ConnectivityEvent/DeepLinkEvent/QrScanEvent/ThemeChangeEvent/LocaleChangeEvent) — 31 in total.parse_event(event_type, raw)— boundary gate: validates a raw payload into a typed event or raisesEventValidationErrorwith structured per-field errors. This is the Python↔Kotlin contract for the device bridge.
See the events guide.
Core — IR + reconciler (tempestroid.core)¶
Node,Path— the lowered IR.- Patches:
Insert,Remove,Update,Reorder,Replace, and thePatchunion. build(widget) -> Node,diff(old, new) -> list[Patch].App[S]— renderer-agnostic state container: holds the state, builds viaview(app), diffs, and hands patches to anapply_patchescallback.
Introspection (tempestroid.core)¶
introspect()— the full JSON contract{"widgets": {...}, "events": {...}}(powerstempest spec).widget_catalog(),event_catalog().
Qt renderer (tempestroid.renderers.qt, needs the qt extra)¶
run_qt(state, view, *, title, size)— run an app in the Qt simulator.run_dev(app_path)— thetempest devcockpit.
Device side¶
Compose, JNI bridge, dev server, and native capabilities — see the Device side (bridge) page.