Skip to main content

Module prelude

Module prelude 

Source

Macros§

routes
Define a plain routes enum and its Route impl in one shot:

Structs§

A11yBuilder
Affine
A 2-D affine transform (CoreGraphics row-vector convention): a point p maps to (a·p.x + c·p.y + tx, b·p.x + d·p.y + ty). Used by canvas transform ops for shape rotate/scale/offset — every native 2-D context concatenates it onto its CTM identically.
Alert
A dialog / confirmation / action sheet. Buttons carry a typed payload T; .present() awaits and returns the chosen button’s payload, or None on cancel/dismiss.
AnimSpec
Animation intent (§8.4). Native-widget backends map it onto their own animator (Core Animation, ViewPropertyAnimator, XAML Composition, OH_ArkUI_AnimateTo, …); the canvas/self-driven path samples curve via Curve::fraction. Threaded through Toolkit::update/set_frame/ set_opacity/set_transform.
Animation
Animation intent (§8.4). Native-widget backends map it onto their own animator (Core Animation, ViewPropertyAnimator, XAML Composition, OH_ArkUI_AnimateTo, …); the canvas/self-driven path samples curve via Curve::fraction. Threaded through Toolkit::update/set_frame/ set_opacity/set_transform.
AnyPiece
Type-erased piece for heterogeneous branches and dynamic construction.
AssetName
The bundled-data name that resource resolves by (the full file name, extension included).
BackRequest
The deferred pop handed to a Stack::on_back guard. Hold it, then call proceed to perform the back the guard consumed (the unsaved-changes → confirm → leave flow).
BuildCx
Color
sRGB color, 0.0–1.0 components. Semantic theme tokens (§6.3) resolve to these in the backend.
Confirm
A yes/no confirmation. Resolves to true only if the confirm button is chosen.
Cover
Drag
Drag info delivered to a shape’s .on_drag handler.
Draw
Duration
A Duration type to represent a span of time, typically used for system timeouts.
Edges
A set of screen edges, for the defers_system_gestures modifier (docs/cover.md). Mirrors SwiftUI’s Edge.Set: on iOS these map to UIRectEdge for preferredScreenEdgesDeferringSystemGestures; on Android any non-empty set enters swipe-to-reveal immersive mode (the closest platform analogue).
Effect
A reaction that re-runs when its tracked reads change. Runs once at creation.
FileUrl
A cross-platform handle to a file the user chose in a native open/save picker.
FilledButtonStyle
A filled, rounded button style: a solid color background with a white label and comfortable padding, composed from Decorate::padding/Decorate::background/Decorate::corner_radius. v1 is static (no pressed/hover feedback).
FontFamily
The family name of a bundled custom font, feeding Font::custom. Holds a &'static str (so Font stays Copy); generated res::fonts::… constants supply it. The untyped Font::Custom(&'static str, f64) variant remains the escape hatch for a family known another way.
FontSpec
The full font descriptor a label carries: a semantic (or custom) Font style plus an optional weight override and italic flag. Backends resolve this to one native font.
FormSection
One grouped form section (created by section): an optional header above a rounded card whose background is the platform’s own theme-adaptive grouped-content material (SurfaceRole::SectionCard — quaternary fill on AppKit, libadwaita .card, Qt palette(alternate-base), tertiary system fill on iOS, Material surface-container, the XAML card brush), so it follows light/dark mode with no app code.
Grid
GridRow
ImageName
The bundled-image name that image callers resolve by (the file stem).
Insets
Logical insets: leading/trailing resolve against the layout direction at place time (§7.8).
ItemSlot
A Copy handle to one keyed item’s state — the unified each/list contract (§5.4).
LinearGradient
A linear gradient (docs/shapes.md §3.2 / §7): color stops along the line from start to end, both in the unit space of the filled shape’s bounding box. Stops are (offset 0..=1, color), ascending.
Link
A tappable run of text that opens url in the platform’s default handler — the system browser for http/https, the mail client for mailto:, and so on. This is Day’s analogue of SwiftUI’s Link.
List
A native recycling list: the platform widget owns scrolling + cell reuse; Day builds each visible row once and rebinds it (a slot-write into its ItemSlot) as cells recycle. Shares the ItemSlot row contract with each; migrating is a one-word change.
LocalizedText
A localized text source: label(tr("greeting").arg("name", name)) (§12.2).
Memo
Cached, equality-diffed derived value (§4.2).
MenuEntry
A menu entry under construction. Build a command with menu_item, a nested submenu with sub_menu, a standard system command with menu_role, and a divider with menu_separator. Attach to a Piece via [Decorate::context_menu] or install app-wide via app_menu.
NativeRef
A liveness-checked reference to a mounted piece’s realized node — the retained half of the tweaks API (docs/tweaks.md). Capture one with Decorate::native_ref, then reach the native widget later (from event handlers, timers) through a toolkit ext accessor. node/with yield None before mount and after the node’s subtree is disposed, so async races are safe no-ops.
NavItem
One data-driven selector item, returned by item inside a Selector::items mapper.
OpenFile
A native “open file” picker. .await (or .present().await) resolves to the chosen FileUrl, or None if the user cancels.
Picker
A native picker bound two-way to selected. Style via .menu()/.segmented()/.inline().
PieceVec
Runtime-heterogeneous children (column_vec-style call sites).
Point
Prompt
A single-line text prompt. Resolves to Some(text) on OK, None on cancel/dismiss.
RNode
Realized-node key. NodeId (the spec-boundary id) is its FFI encoding.
RadialGradient
A radial gradient (docs/shapes.md §3.2 / §7): color stops from center outward. Both the center and the radius live in the unit space of the filled shape’s bounding box, so the gradient stretches into an ELLIPSE when the bounds aren’t square (the XAML relative-brush behavior; the other backends reproduce it with a local matrix on a circular gradient). A radius of 0.5 from the default center touches the edge midpoints of the bounds.
Rect
Resource
A handle to a bundled resource’s bytes with efficient random read-only access.
RoutePath
A typed absolute route: segments built from Route values plus query params. route(&Section::Stack).then(&Drill::Item { id: 42 }).param("hint", "linked") encodes to "stack/item-42?hint=linked"RoutePath::navigate it, or hand it to nav_link_to.
SaveFile
A native “save file” picker carrying the bytes to write. .await resolves to the chosen destination FileUrl, or None on cancel.
Scope
Ownership scope for signals/effects (§4.3). Copy handle; not Send.
Selector
A one-of-N selector whose active key is an app-owned signal (two-way, exactly like Picker/Toggle). Deep links and dayscript address items by key (docs/navigation.md).
Setter
Send write-only handle to a signal; delivery hops to the UI thread via the main poster. Writes after disposal are silent no-ops (§4.3).
ShapePiece
A shape piece — one data-oriented piece parameterised by ShapeKind, rendered atop the canvas.
Shortcut
A keyboard shortcut for a menu item. primary is the platform’s command modifier — ⌘ on Apple, Ctrl on GTK/Qt/XAML — so one declaration reads correctly everywhere. key is a single character ("s", ".") or a named key ("Return", "Delete", "Left", "F1").
Signal
A Copy, !Send reactive value handle (§4.2).
Size
Stack
A push/pop navigation stack whose contents are an app-owned Signal<Vec<K>> (the path above the root). Day reconciles the native stack to the path; the native back button writes the pop back into it (docs/navigation.md).
TextArea
A native multi-line text editor bound two-way to text. Configure a prompt with .placeholder(_), the auto-growing height band with .min_lines(_) / .max_lines(_), and the native editor attributes with .editable(_) / .selectable(_) / .spellcheck(_) (each accepts a constant or a reactive bool, and updates live). A backend that can’t honor an attribute answers the matching Cap::Text{Editable,Selectable,SpellCheck} with Support::Unsupported.
TextStyle
Canvas text styling (named fields per the API style rule, docs/api-style.md).
ToolbarEntry
A toolbar item under construction. Build a command with toolbar_button, a two-state button with toolbar_toggle, a pull-down with toolbar_menu, a search field with toolbar_search, and the gaps with toolbar_space / toolbar_flexible_space.
ToolbarItem
One item in a window’s toolbar (docs/toolbars.md).
Transform
A cheap per-node visual transform (§8.4 animation): translation, uniform/non-uniform scale, and rotation about a unit anchor (0.0..1.0 within the node’s bounds; default center). Distinct from the layout frame — animating a Transform never triggers relayout, so it is the vehicle for movement/scaling animation. Each backend composes it onto the node’s laid-out frame via its native transform channel (CALayer/GskTransform/RenderTransform/NODE_TRANSFORM/…).
Trigger
Data-less invalidation source.
UnitPoint
A point in the unit space of a shape’s bounding box: (0,0) = top-leading, (1,1) = bottom-trailing. Gradient geometry is expressed in unit points so one paint value works for any shape size (docs/shapes.md §3.2).
VectorName
The bundled-vector name that vector callers resolve by (docs/vectors.md): the stem of a resource/vectors/ SVG (or .symbolset bundle). Vectors and images share one per-backend resolution namespace — staging guarantees every vector name resolves as whatever form that backend loads natively (a VectorDrawable, a catalog entry, a rasterized PNG).
WindowOptions
ZStack
A z-stack: children are layered back-to-front (the first child sits at the bottom), all sharing the container bounds and positioned by the stack’s Alignment. The stack sizes to the UNION (max width/height) of its children — contrast [Decorate::overlay], which sizes to its content and treats the overlaid piece as a non-sizing annotation. Pure composition: it is the same native panel as [column]/row, so there is no per-backend work.

Enums§

Alignment
Two-axis placement of a child within a container’s bounds (SwiftUI’s Alignment). Used by the z-layering primitives (OverlayLayout): zstack, overlay/overlay_aligned.
BackResponse
What a Stack::on_back guard returns for one back-like event (a native back gesture/button, or nav_back). Programmatic path writes are NOT guarded — the guard is a policy on the user’s back affordance, matching Jetpack Compose’s BackHandler (docs/navigation.md).
Cap
Corner
A corner radius: absolute points, or a 0..1 fraction of min(width, height).
Curve
The timing curve of an animation (§8.4). Native backends map each variant onto their own easing (CAMediaTimingFunction, QEasingCurve, ArkUI ARKUI_CURVE_*, spring animators); the canvas/self-driven path samples it via Curve::fraction. Spring matches SwiftUI’s .spring(response:dampingFraction:).
DragPhase
The phase of a drag gesture (docs/shapes.md).
DrawOp
Font
A semantic (logical) text style. Each maps to the PLATFORM’s native text style where the toolkit has one — UIFont/NSFont.preferredFont(forTextStyle:) on Apple (Dynamic Type), the *TextBlockStyle resources on XAML — so a Day app matches the OS’s own typography and inherits its accessibility text scaling for free. Backends without semantic styles (GTK/Qt/Android) approximate with sizes that still track the platform’s text-scale / font-scale accessibility setting.
FontWeight
Font weight, matching UIFont.Weight / SwiftUI Font.Weight (lightest → heaviest). Ordered by heaviness, so backends can e.g. map >= Semibold to a synthesized bold face.
GestureKind
A gesture a node wants delivered. Backends attach the matching native recognizer when day-core calls Toolkit::enable_gesture; the default is no gesture (recognizers cost, so opt-in).
HAlign
LayoutDirection
Lifecycle
An app-lifecycle phase (docs/lifecycle.md). Each backend maps these onto its OS’s native app / activity delegate. Some phases only exist on some platforms — a mobile app truly enters the background and can be low on memory, a desktop app essentially cannot — so Lifecycle::is_universal marks the ones every backend delivers, and Toolkit::supports_lifecycle reports per-backend truth.
MenuBarRole
A standard menu-bar slot (macOS’s File/Edit/View/Window/Help, and their counterparts elsewhere). A backend that has a house style for the menu bar fills every slot an app did not claim with its own stock menu, so an app never has to restate the platform’s furniture — and can still replace any of it by tagging its own submenu with the matching role.
MenuItem
One entry in a menu (recursive — a Submenu nests).
MenuRole
A standard/system command. The backend supplies the NATIVE item — selector on AppKit/UIKit (cut:/copy:/paste:…), a stock action on GTK/Qt/XAML — so it targets the focused control, gets the platform’s default label + shortcut, and enables/disables itself automatically. This is how default items (Edit ▸ Cut/Copy/Paste, the app’s Quit/About) are accommodated without the app re-implementing them.
Paint
A fill source: a solid color, or a linear/radial gradient (docs/shapes.md §3.2 — angular and semantic tokens are later phases). From<Color> keeps every existing fill(shape, color) call site compiling unchanged.
PickerStyle
SwiftUI’s pickerStyle analogue (kinds::PICKER). Each maps to a distinct native control per toolkit (docs/picker.md).
Reactive
A parameter that is either a constant or a reactive source. get() is a tracked read, so any Reactive used inside a canvas draw closure makes that shape re-record when the source changes.
Reorder
A reorder guard’s verdict on a proposed row move (docs/list.md): consulted synchronously from the native drag’s validate hook, so the affordance (gap, insertion mark, forbidden cursor) reflects the answer while the user is still dragging.
Role
RowHeight
How a recycling list sizes its rows (docs/list.md).
ScrollTarget
A programmatic scroll destination (§7.6, docs/scroll.md). Edges are axis extremes (Top/Bottom vertical, Leading/Trailing horizontal — start/end in layout direction); Offset pins the viewport origin to a content-space point (clamped by the platform); Id reveals the element with that dayscript id inside its nearest enclosing scroll.
SelectorStyle
How a selector presents its one-of-N choice.
Shape
ShapeKind
A shape’s geometry, resolved against the rect layout assigns it (frame-relative, SwiftUI-style).
Support
Symbol
A standard icon, named by what it MEANS rather than by how it looks, so each backend can draw the platform’s own glyph for it — an SF Symbol on macOS, a freedesktop icon name on GTK and Qt, a Fluent glyph on Windows. This is the only way an icon looks native on every desktop at once; a bundled PNG cannot, because it is one artist’s take on all four.
TextAnchor
How canvas text hangs on its at point (style rule: no bare bools in public APIs).
ToolbarItemKind
What a toolbar item IS. The variants are the vocabulary every desktop toolbar shares; each backend realizes one with its native control, never with a drawn imitation.
ToolbarValue
A value a toolbar item produced.
VAlign
VectorWeight
A vector glyph’s stroke weight (docs/vectors.md). Template-form sources (SF template SVGs, .symbolset bundles) carry true per-weight art; plain SVGs alias every weight to the same glyph, so .weight(…) degrades to Regular rather than to a missing asset.

Traits§

Animatable
Linear interpolation of animatable values (t in 0.0..1.0). This drives the canvas / self-driven animation path (docs/shapes.md §5) and Qt’s sampled spring; native-widget animation does NOT use it — the toolkit interpolates on its own compositor.
ButtonStyle
A pluggable button appearance (the SwiftUI ButtonStyle analog). Pure composition — a style builds its body from existing pieces/decorators, so it needs no per-backend native code. Apply one with Button::style.
Decorate
IntoFocusBinding
A focus-binding target for [Decorate::focused] (docs/focus.md): either a Signal<bool> (one control) or a (Signal<Option<K>>, K) pair (one control of a group sharing a signal). The two-marker split is the same E0119 dodge as IntoText.
IntoFraction
Disjoint-marker conversion (like IntoText) so progress(_) accepts a constant f64, a Signal<f64>, or a closure. Reuses the same marker types.
IntoReactive
Disjoint-marker conversion (like IntoText): accepts T, Signal<T>, or Fn() -> T.
IntoText
Disjoint-marker conversion (the coherent form of §12.2’s IntoText): literals, String, Signal<String>, and closures all convert, each under its own marker.
Modifier
A one-shot, by-value view transform (the SwiftUI ViewModifier analog): wrap a piece into a new one. Pure composition — no per-backend work. A plain FnOnce(AnyPiece) -> AnyPiece closure is a Modifier too (the blanket impl below), so the common case needs no new type. Apply one with Decorate::modifier.
Piece
A UI description consumed once (§5.2). Returns the root realized node it created.
PieceSeq
Children of a container: a tuple of pieces (the floem ViewTuple pattern — implemented ONLY for tuples, (), and PieceVec, never via a blanket, to stay coherent).
Route
A typed route key — the compile-checked alternative to raw string keys.
SignalRw

Functions§

alert
app_menu
Install the application menu — the native menu bar on desktop, the app-bar overflow on Android, the UIMenuBuilder main menu on iPadOS/Catalyst. Top-level entries are usually sub_menu(...)s (the menu-bar menus). Call at startup or whenever the menu changes; it replaces any previous app menu.
app_menu_reactive
app_menu that re-lowers and re-installs whenever a locale-tracked read inside the builder changes — menu_role labels, res::str titles, and day::tr all read the locale signal, so a runtime language switch rebuilds the menu in the new language (docs/menus.md). Replacement drops the previous install’s action closures (context menus are unaffected). The binding lives in a root-owned scope: install once, at startup.
app_temp_dir
An app-writable scratch directory: the backend-supplied one, else std::env::temp_dir(). Used by the file-save flow (docs/files.md) to stage bytes before the native save picker.
arc
batch
bind
The binding primitive (§4.2): compute (tracked) + apply (untracked), equality-gated. Structural priority — bindings drain before plain effects. apply receives the new value by reference so V needs only PartialEq (no Clone).
button
canvas
The drawing closure is a binding: signal reads re-record; layout size changes re-record (via FrameChanged); replay is equality-gated by DrawOp’s PartialEq (§4.2).
capability
Query the active toolkit’s support for a capability (docs). Lets app/piece code adapt its own content to the backend — e.g. a page can skip a title the native nav already shows in a header (Cap::NavHeader), or pick a presentation from Cap::NavSplit.
capsule
circle
column
confirm
cover
A fullscreen cover over open: Some(r) presents build(&r), None dismisses (docs/cover.md). Registers a string-route adapter, so navigate("<key>") opens it and nav_back() closes it, and current_route() reports the presented key.
current_route
The FULL current route — every mounted surface’s contribution, outermost to innermost, /-joined. Round-trips through navigate: persist it on exit, navigate(&saved) on launch (docs/navigation.md).
divider
each
Reactive keyed collection (§5.4): keyed diff, per-key child scopes, slot writes for surviving keys, debug key-uniqueness assertion.
ellipse
environment
Read the nearest ambient T provided by an enclosing with_environment, or None if none is in scope. Call it while constructing or building a piece within that subtree.
form
A settings-style form: a vertical run of sections whose labeled rows share one label column across the WHOLE form.
frame_clock
A frame clock (§8.4): an invisible, zero-size piece that calls tick every animation frame with the wall-clock delta since the previous frame, for as long as it is mounted. Drop it into the tree (e.g. behind a canvas in a zstack) to drive a game loop or self-driven animation: the tick mutates state Signals, and a canvas reading them re-records that frame.
grid
A SwiftUI-style eager grid (docs/grid.md): columns are inferred from grid_row children — a column is as wide as its widest cell, a grow_w cell makes its column share the leftover width evenly, and a non-row child becomes a full-width cell spanning every column. spacer() inside a row is an inert empty cell that still occupies its column (a grid has explicit gutters, so stack-style push-apart spacers don’t apply). Cells opt into spans and per-cell alignment with [Decorate::grid_span] / [Decorate::grid_align].
grid_row
One row of a grid: each child is a cell, assigned to columns left to right. Outside a grid a row degrades gracefully to a plain row. Rows are transparent carriers — the grid places their cells directly — so decorating a grid_row itself is unsupported (decorate the cells, or the grid).
image
install_locales
Register the app’s locales (see day_l10n::install) and fix the layout direction from the locale that actually resolved (docs/localization): an RTL locale (Arabic, Hebrew, …) mirrors every horizontal placement and flips the native toolkit’s direction. Direction is resolved once, before the first layout — runtime set_locale switches strings but not direction.
invalidate_size
Tell layout that a node’s intrinsic size may have changed. For tweaks (docs/tweaks.md): after a native call that alters a widget’s preferred size (fonts, tick marks, bezel styles), the measure cache along the node’s path must be invalidated — Day can’t see native mutations it didn’t make. Relayout runs at the next turn boundary as usual. No-op on a disposed node.
is_rtl
Whether the app is being rendered right-to-left (docs/localization) — a convenience over layout_direction. The layout engine already mirrors widget placement under an RTL locale, but a canvas draws in its own coordinate space, so a custom drawing that has a reading direction (a battery that drains one way, an arrow, a progress sweep) can call this to mirror itself. Fixed for the life of the process, like layout_direction.
item
A selector item for a data-driven list: item(room.id, room.name).icon(res::images::room) (docs/navigation.md). Used inside the .items(signal, |t| …) mapper; the page it selects is built by the selector’s Selector::destination.
label
labeled
A form row: label sits in the form-wide aligned label column (right-aligned, vertically centered), control beside it. Outside a form the label column is just this row’s own label width. A control with .grow() stretches to the row’s remaining width.
layout_direction
The app-wide layout direction (docs/localization): mirrors every horizontal placement in the place pass when day_geometry::LayoutDirection::Rtl. Resolved lazily from the DAY_LOCALE launch environment (so toolkits can read it before any UI exists); set_layout_direction (called by install_locales for the resolved locale) overrides. Fixed for the life of the process — switching locale at runtime does not re-mirror.
lifecycle_supported
Does the running backend deliver phase? Use this to guard registration at runtime: if day::lifecycle_supported(Lifecycle::DidEnterBackground) { on_lifecycle(...) }.
line
A stroked segment between two unit points of the frame: line((0.16, 0.5), (0.84, 0.5)).
link
Build a Link that opens url when tapped.
list
Build a recycling list from a reactive items closure, a key function, and a row builder.
matches_search
matches_search_in against the CURRENT locale. Reads the locale signal (tracked), so a filtered list inside a reactive closure re-filters when the language changes — the same contract crate::compare has.
menu_item
A clickable command: menu_item("Save").key("s").action(|| …).
menu_role
A standard/system command (MenuRole::Copy, MenuRole::Quit, …) rendered with the platform’s NATIVE item — correct label, default shortcut, focus-targeting, and automatic enable/disable — so default menu items (Edit ▸ Cut/Copy/Paste, the app’s Quit/About) work without re-implementation.
menu_separator
A visual divider between items.
nav_back
Pop one navigation level. False = nothing to pop.
nav_link
A tappable link that navigates to path when pressed.
nav_link_to
A tappable link that navigates to a typed RoutePath when pressed.
navigate
Navigate to a route (docs/navigation.md).
navigate_to
Navigate to a single typed key, RELATIVE (innermost surface first) — the typed navigate(&r.key()), percent-escaped. For absolute paths chain a route.
on_lifecycle
Register f to run whenever the app reaches phase. Handlers run in registration order, in a reactive batch (signal writes coalesce into one UI update). Register early — before launch, or at the top of the root builder — so WillLaunch/DidLaunch handlers are in place when they fire.
open_file
Start a native open-file picker (docs/files.md).
open_url
Open url in the platform’s default handler (system browser for http(s), mail client for mailto:, …). The seam behind the link piece; call it directly from a tap handler for a custom affordance. Fire and forget — no result, unopenable URLs are ignored by the backend.
picker
picker(["A", "B", "C"], choice).segmented() — options are fixed, selected is the bound index.
piece_fn
A piece from a closure.
polygon
A polygon of unit points of the frame: polygon([(0.5, 0.0), (1.0, 1.0), (0.0, 1.0)]).
progress
A determinate progress bar. fraction is the completed portion in 0.0..=1.0; pass a constant, a Signal<f64>, or a closure and it tracks reactively (out-of-range values are clamped).
prompt
rectangle
SwiftUI-ergonomic sugar — all build the same ShapePiece.
resource
Open a bundled resource by name for efficient random read-only access.
rounded_rectangle
route
Start a typed RoutePath at the outermost segment.
route_param
One query param of the most recent navigate (None = not present).
route_params
The query params of the most recent navigate (?name=value&…) — read inside a destination builder. See docs/navigation.md for when params apply.
row
safe_area
The window’s safe-area insets, in points. Zero on every backend that clamps Day’s root to the safe area natively (the default everywhere); nonzero only where a backend runs the root edge-to-edge — today day-android’s opt-in immersive mode (docs/layout.md, the android platform page). Compose it yourself where a background should run under the system bars: paint the background unpadded, pad the content by these insets. The read is tracked, but layout attributes like .padding capture the value at build time — a mid-run inset change (rotation) does not re-pad already-built pages.
save_file
Start a native save-file picker for data (docs/files.md).
scroll
section
A grouped card of form rows; .title(…) adds the header. Works inside a form (shared label column) or standalone.
selector
set_locale
Switch the locale at runtime — every tr/binding re-runs.
shape
The unified constructor: shape(ShapeKind::RoundedRectangle { corner: 12.0.into() }).
shape_group
Flatten many shape descriptions into ONE canvas leaf — one native view no matter how many shapes (docs/shapes.md §3.6). Shapes draw in order; reactive properties re-record the group. Child gestures are not wired inside a group — put .on_tap on the group via Decorate.
shape_group_fn
Size-aware shape_group: the closure derives the shapes from the laid-out size and re-runs on FrameChanged, exactly like canvas — for geometry that depends on the final size (e.g. data mapped along the width).
slider
sort_localized
Sort a slice in place in the CURRENT locale’s collation order (tracked, like compare).
spacer
spinner
An indeterminate, animated progress indicator (a spinner / busy bar) for work with no known extent.
stack
sub_menu
A nested submenu: sub_menu("File", vec![menu_item("New"), …]).
text_area
text_area(text) — a native multi-line editor whose contents mirror text in both directions.
text_field
toggle
toolbar
Install the toolbar on the window being built — the primary window at startup, and the new window inside a register_new_window builder. Replaces any previous toolbar on that window; an empty items removes it. Add or remove an item by calling this again with a different list, or use toolbar_reactive to keep the list derived from state.
toolbar_button
A push button: toolbar_button("refresh", tr("refresh")).icon(Symbol::Refresh).action(…).
toolbar_flexible_space
A gap that absorbs the leftover width. Everything before the first one is packed to the leading edge and everything after it to the trailing edge, which is how each toolkit’s own packing (GTK’s start/end, XAML’s content/commands) is expressed in one ordered list.
toolbar_label
Static text in the bar — a status or a caption.
toolbar_menu
A button that drops a menu, built from the same entries crate::app_menu takes.
toolbar_reactive
toolbar that re-lowers and re-installs whenever a reactive read inside builder changes — a locale switch, or a command list that depends on what is selected.
toolbar_search
A native search field bound two-way to queryNSSearchToolbarItem, GtkSearchEntry, a Qt search QLineEdit, an AutoSuggestBox. Set the prompt with .placeholder(_).
toolbar_separator
A divider, where the platform draws one (macOS toolbars have none — AppKit renders it as a fixed gap; docs/toolbars.md).
toolbar_space
A fixed gap.
toolbar_toggle
A two-state button bound to on: the user flipping it writes the signal, and writing the signal restyles the button.
tr
untrack
Run f without tracking reads.
vector
watch
Derive-state without effect-write loops (§4.2): source is tracked; cb runs untracked with (new, old). Does NOT fire for the initial value.
when
Reactive conditional subtree. The anchor is a layout-transparent group; the active arm lives in its own child scope, disposed on switch (§4.3).
with_animation
Explicitly animate every state change made in f — Day’s equivalent of SwiftUI’s withAnimation. The mutation runs inside a day_reactive::batch; that batch’s synchronous fixpoint drain (bindings → patch, plus the turn-end layout → set_frame) executes while spec is ambient, so the resulting native updates carry the animation intent and the toolkit animates them on its own compositor. Nesting overrides; the previous ambient restores after.
with_environment
Provide an ambient value T to content and its ENTIRE descendant subtree (the SwiftUI @Environment/.environment(_) analog, layered over day-reactive’s scope context). content — and any piece built within it — reads it back with environment. A thin, non-reactive wrapper: T is a snapshot captured here; for a value that must react, provide a Signal<T> (or a Memo<T>) and read it reactively inside the subtree.
zstack
Build a ZStack from a tuple of children (or a PieceVec).
Day API ↩ Guides· daybrite.dev