Skip to main content

Module prelude

Module prelude 

Source

Re-exports§

pub use ::day_model::Uuid;
pub use ::day_model;
pub use super::log;

Modules§

async_image
Images decoded from reactive bytes, with a placeholder and optional clipping. Uses the core decoder and canvas; no toolkit-specific image pipeline or HTTP dependency.

Macros§

build_path
Turn SVG path data into a PathBuilder chain, at compile time.
debug
Logging (docs/logging.md). day::info!("…") and friends are the log crate’s macros, re-exported so an app needs no log dependency of its own for the common case. Because they are log’s, anything that speaks log (env_logger, tracing-log, a hand-written log::Log) works without adapters.
error
Logging (docs/logging.md). day::info!("…") and friends are the log crate’s macros, re-exported so an app needs no log dependency of its own for the common case. Because they are log’s, anything that speaks log (env_logger, tracing-log, a hand-written log::Log) works without adapters.
id
Declare an ID at its piece, including a link-time catalog entry.
info
Logging (docs/logging.md). day::info!("…") and friends are the log crate’s macros, re-exported so an app needs no log dependency of its own for the common case. Because they are log’s, anything that speaks log (env_logger, tracing-log, a hand-written log::Log) works without adapters.
log_enabled
Logging (docs/logging.md). day::info!("…") and friends are the log crate’s macros, re-exported so an app needs no log dependency of its own for the common case. Because they are log’s, anything that speaks log (env_logger, tracing-log, a hand-written log::Log) works without adapters.
routes
Define a plain routes enum and its Route impl in one shot:
trace
Logging (docs/logging.md). day::info!("…") and friends are the log crate’s macros, re-exported so an app needs no log dependency of its own for the common case. Because they are log’s, anything that speaks log (env_logger, tracing-log, a hand-written log::Log) works without adapters.
warn
Logging (docs/logging.md). day::info!("…") and friends are the log crate’s macros, re-exported so an app needs no log dependency of its own for the common case. Because they are log’s, anything that speaks log (env_logger, tracing-log, a hand-written log::Log) works without adapters.

Structs§

A11yBuilder
The annotations .a11y(|a| …) collects (docs/accessibility.md). The three strings are TextSources, so each takes a literal, a String, a Signal<String> or a closure: a gauge’s value follows the gauge, and a localized label follows the locale.
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.
AnyBinding
A type-erased Binding: what a piece stores when its builder takes impl Binding<T> (docs/api-style.md “Three input spellings”), so the piece itself needs no type parameter per bound value.
AnyPiece
Type-erased piece for heterogeneous branches and dynamic construction.
AssetDir
A bundled-asset directory (§18.5): a folder’s path relative to resource/assets/, /-separated, no trailing slash. The generated res::assets::… tree carries one constant per folder, sharing its module’s name: res::assets::web::minisite is the AssetDir and res::assets::web::minisite::index_html a file within it.
AssetName
The bundled-data name that resource resolves by: the file’s path relative to resource/assets/, /-separated (a top-level file is just its file name, extension included).
AsyncImage
A growing image surface. Empty and invalid sources show the placeholder.
BackRequest
The deferred pop handed to a NavStack::on_back guard. Hold it, then call proceed to perform the back the guard consumed (the unsaved-changes → confirm → leave flow).
Branches
The plain-data NodeSource built by branches.
BuildCx
CanvasExports
What this toolkit can export a canvas drawing to (Cap::CanvasBitmap, Cap::CanvasPdf). Read it to enable or hide export commands, the way image_encode_formats decides which formats to offer.
CanvasFont
What canvas text is drawn with beyond its size (docs/canvas.md “Text”): a family, a weight and a slant. The default is the platform’s own UI face, regular, upright, which is what every backend drew before the field existed, so a default font encodes to nothing on the wire.
Color
sRGB color, 0.0–1.0 components. Semantic theme tokens (§6.3) resolve to these in the backend.
ColorPicker
A color well bound two-way to a Color signal. Build with color_picker.
ComboBox
A native combo box bound two-way to text, with a reactive dropdown of items.
Command
An application operation shared by buttons, menus, toolbars, and direct callers (docs/commands.md): one id, one title, one availability, one handler, presented through button, menu_item and toolbar_item.
Confirm
A yes/no confirmation. Resolves to true only if the confirm button is chosen.
ContentList
The content-list pane of a Mail-shaped nav (docs/navigation.md), declared with Nav::content_list: mailboxes, message list, message. build makes the middle column, built once and resident for the host’s life; its content follows the app’s own signals (the selection scoping it, the row chosen from it), never a rebuild.
CornerRadii
A radius for each corner of a rectangle, clockwise from the top left (docs/canvas.md “Rounded corners”). The shape a bar in a chart wants (rounded at its value end, square against its axis), a tab (rounded on top), or a card joined to its neighbor.
Cover
DatePicker
A native date picker bound two-way to a DayDate signal. Build with date_picker.
DayDate
A civil (zoneless) calendar date, proleptic Gregorian. Ordered chronologically; Display and DayDate::parse_iso speak ISO-8601 (YYYY-MM-DD).
DayTime
A civil (zoneless) wall-clock time. Display and DayTime::parse_iso speak ISO-8601 (HH:MM, or HH:MM:SS when seconds are nonzero).
Decorated
A piece with modifiers chained onto it, keeping the decorated piece’s type (§5.2).
Delete
Swipe-to-delete for a list() (docs/list.md): the handler that applies a committed delete, the label the platform puts on its affordance, an optional per-row guard, and whether the gesture is offered right now. A list is deletable exactly when it carries one of these (list(..).deletable(Delete::new(f))).
DocumentTabs
A resident, closable document surface. Content is built once per key and disposed on removal. A selected document owns its native focus and command context.
Drag
Drag info delivered to a shape’s .on_drag handler.
Draw
Drawing
A recorded drawing at a fixed size: what a canvas would replay, kept for export.
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.
Elem
One element of a keyed store, addressed by a key that survives reordering.
ElementId
An application-owned element identity, declared with crate::id!.
Field
One field, projected out of any Source. Copy, itself a Source (so fields nest), and a Binding (so every control binds to it).
FileAccess
A resolved file and the lifetime of its native access grant. Borrow the file while doing I/O; a cloned path alone does not retain access after this guard is dropped.
FileUrl
A cross-platform handle to a file the user chose in a native open/save picker.
FontFace
One face a font family ships (docs/fonts.md): its display name (“Bold Italic”), weight and slant. What FontFamilyInfo::faces lists and what a font menu’s style picker offers.
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.
FontFamilyInfo
A platform (or bundled) font family and the faces it can draw canvas text in (Toolkit::font_families, docs/fonts.md).
FontSpec
The full font descriptor a label carries: a semantic (or custom) Font style plus an optional weight override, an italic flag, and the tabular-figures request. Backends resolve this to one native font.
Form
A whole form, created by form: the shared label column wrapped around a vertical run of sections.
FormSection
One grouped form section (created by section): an optional header above a rounded card whose background is the platform’s 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 resource() callers resolve by (the file stem).
Insets
Logical insets: leading/trailing resolve against the layout direction at place time (§7.8).
Inspector
Window content beside a trailing inspector panel, visibility bound to visible (docs/inspector.md).
ItemSlot
A Copy handle to one keyed item’s state: the unified each/list contract (§5.4).
Keyed
A keyed collection that keeps its own key→index map, so an element read is O(1) rather than a scan, and no caller can forget to maintain the map, because the collection does it.
Labeled
One form row, created by labeled: a label in the form-wide column beside its control.
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 navigates to a #route or opens a URL in the platform’s default handler: the system browser for http/https, the mail client for mailto:, and so on.
List
A native recycling list: the platform widget owns scrolling + cell reuse; Day builds each visible row once and rebinds it as cells recycle. Takes any RowSource; shares the row contract with each, so migrating a collection between them is a one-word change.
ListItem
A list row’s standard content, built by list_item (docs/list.md “List items”).
Loaded
The loaded value, handed to a load’s ready arm: get() is a tracked read that follows Ready(a) to Ready(b) in place, without rebuilding the arm. Copy, like a signal.
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.
ModelId
A typed, opaque id for one M row: Copy, 8 bytes, cheap to pass and compare. It wraps the key’s path handle: Store::elem, query results, list slots and destinations all speak it, and a wrong-model id is a compile error rather than a wrong row. ModelId::key recovers the real key for display, deep links, or the persistence edge.
ModelSlot
One recycled row’s connection to its store: the slot a model list’s row builder receives. Copy, and a day-model Source, so #[derive(Observable)] accessors hang off it. text_field(slot.name()) binds two-way and follows the slot to its next row when the cell recycles, because the slot resolves its row on every operation.
Move
A native hierarchical tree (docs/tree.md): rows nest, disclose, and drag to a new parent. The platform widget owns scrolling, disclosure and cell reuse; Day builds each visible row once and rebinds it as cells recycle (list()’s contract, token-addressed). Gate its UI on Cap::Tree: a backend without tree support renders nothing. Drag-to-move for a tree (docs/tree.md): the handler that applies a committed re-parent, an optional guard consulted while the drag is live, and whether the gesture is offered right now. A tree is movable exactly when it carries one of these (tree(..).movable(Move::new(f))). The list() counterpart is Reorder.
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.
Nav
NavItem
One nav item (docs/navigation.md): a key, a title, and its decorations, built by item. The same value describes a static destination (item("home", title).page(home_page)) and a row of a data-driven block (nav_items(move || feeds(), |f| item(f.id, f.name))).
NavStack
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).
OpenFile
A native “open file” picker. .await (or .present().await) resolves to the chosen FileUrl, or None if the user cancels.
OpenFiles
A native “open files” picker that lets the user choose several files at once. .await (or .present().await) resolves to the chosen FileUrls in the picker’s order, or an empty Vec if the user cancels.
OpenFolder
A native “choose folder” picker. .await (or .present().await) resolves to the chosen directory as a FileUrl, or None if the user cancels — and None at once on a toolkit without a folder chooser, so ask Cap::FolderDialog before offering the command (phones answer Unsupported).
Pager
PagerState
Pan
One pan-gesture event, delivered to a .on_pan(…) handler (docs/shapes.md). delta is the movement since the previous event, so apply it incrementally; a discrete wheel tick arrives as a lone Changed.
ParagraphRun
One styled paragraph.
ParagraphStyle
A ParagraphRun’s attributes with no range attached.
Path
An arbitrary 2-D path: any number of contours, straight or curved, with a fill rule.
PathBuilder
Build a Shape::Path: several contours, straight or curved, with a fill rule.
PdfDocument
A PDF of one or more drawings, one per page; each page takes its drawing’s size in PDF points (1/72 inch, the same unit as canvas points: US Letter is 612 × 792, A4 595 × 842).
Picker
A native one-of-N selector bound two-way to a typed value (docs/picker.md). Style via .menu()/.segmented()/.inline().
PieceFn
A closure kept as a concrete piece: the deferral primitive (§5.2).
Pinch
One pinch-gesture event, delivered to a .on_pinch(…) handler (docs/shapes.md). scale is cumulative since Began (1.0 = unchanged); location is the centroid, the anchor a zoom keeps stationary.
Point
Prompt
A single-line text prompt. Resolves to Some(text) on OK, None on cancel/dismiss.
PullRefresh
A scrollable wrapped with pull-to-refresh. Build with pull_to_refresh.
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
Reorder
Drag-to-reorder for a list() (docs/list.md): the handler that applies a committed move, an optional guard consulted while the drag is live, and whether the gesture is offered right now. A list is reorderable exactly when it carries one of these (list(..).reorderable(Reorder::new(f))).
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.
Rows
A display projection over a store: store.rows(move || ordered_keys()). The projection is a tracked read of key ids: read only the fields the order depends on, and a write to any other field cannot re-run it.
RunStyle
A TextRun’s attributes with no range attached: what a toolbar toggles, what an editor applies to a selection, and what it styles the next typed character with.
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.
Search
Search over a navigation surface (docs/search.md), declared with Nav::searchable: Search::new(query).prompt(res::str::search()).reveal(SearchReveal::OnPull).
SearchField
A native search field bound two-way to query. Set a prompt with .placeholder(_).
Sections
Collapsible sidebar sections (docs/navigation.md), declared with Nav::sections. The state is the set of COLLAPSED section ids; missing ids default to expanded, and temporarily filtered-out ids are retained. Pair with Nav::section_id for stable identities; unkeyed headings use their first route as a fallback identity. Takes precedence over Nav::reorder_items; combined collapse/reordering is not supported.
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 parameterized 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
SizeClass
A window’s size class (docs/size-classes.md), reported by the backend and read by apps through day::size_class().
StatusItem
What a status item shows: its icon, text and menu. Built by the closure handed to status_item, which re-runs whenever a signal it reads changes.
Stepper
A stepper field bound two-way to a numeric binding. Build with stepper.
Store
A Copy, process-lifetime handle to one observable value.
StoreTree
A hierarchy over a store: store.tree(children_of) (docs/tree.md). The projection maps a parent key (None = the root) to its ordered child keys, a tracked read, so re-parenting or re-ordering writes re-run it; tokens are the store’s keys.
StrokeStyle
Everything about a stroke except its paint.
StyledText
A styled document: plain text, the character runs over it, and the paragraph attributes over the same offsets.
SwipeAction
One button in a row’s swipe-action offer (docs/list.md): what the platform reveals as the user drags a row aside, built by swipe_action. Holds the label, the styling hints the backend maps onto its own affordance, and the handler the activation runs.
TabActions
Commands shared by native and application-drawn tab chrome.
TabSet
Ordered document identities and the selected document. Own this above the tab host. Payloads (editor buffers, browser profiles, etc.) remain application-owned.
TextAnchor
How canvas text hangs on its at point: one placement per axis (docs/canvas.md “Text”).
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.
TextBuilder
Build a styled paragraph run by run (docs/text-runs.md).
TextEditor
A styled-text editor bound two-way to a StyledText signal. Build with text_editor.
TextMetrics
Single-line text measurement in canvas points (Toolkit::measure_text, docs/fonts.md).
TextPreset
A named text style an app applies to many labels: label(t).preset(&CAPTION) for const CAPTION: TextPreset = TextPreset::new(Font::Caption).secondary();. Every builder is const, so a preset is a constant, not a runtime value, and it composes the same LabelBuilder steps a chain would (docs/text.md).
TextRun
One styled span of a label’s text (docs/text-runs.md).
TextStyle
Canvas text styling (named fields per the API style rule, docs/api-style.md). Fill what you set and take the rest from ..Default::default(): 12 points, black, top-leading, the platform’s own face.
TimePicker
A native time picker bound two-way to a DayTime signal. Build with time_picker.
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, one control over a set of choices with toolbar_segmented, static text with toolbar_label, and a divider with toolbar_separator. Search is declared on the navigation surface instead (Nav::searchable, docs/search.md).
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/…).
TreePiece
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 resource() 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).
When
A conditional subtree, optionally with an else arm. Built by when.
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 NavStack::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).
Cursor
The pointer’s shape over a piece (the .cursor() decorator, docs/cursor.md).
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
Either
A build-time branch between two piece TYPES, without erasing either (§5.1).
ExportError
Why a canvas export could not answer (docs/canvas.md “Exporting”).
FillRule
Which points count as inside when a path’s contours overlap (docs/canvas.md).
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. A Day app thus matches the OS’s own typography and inherits its accessibility text scaling with no extra work. 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
HeightClass
How tall a window is (docs/size-classes.md). Consulted far less than WidthClass: it is what tells a phone in landscape (wide enough for two panes, too short for a tall list) that it should not grow vertical chrome.
InputPurpose
What a text field collects (text_field(..).input_purpose(_), docs/textfield.md).
Key
One element’s key: what its paths, its Keyed slot, and (under persistence) its stored row are addressed by.
LabelStyle
Which halves of an item’s label a platform draws, where it can draw more than one.
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 enters the background and can be low on memory, a desktop app cannot), so Lifecycle::is_universal marks the ones every backend delivers, and Toolkit::supports_lifecycle reports per-backend truth.
LineCap
How a stroked line ends (docs/canvas.md). Names match PDF’s J, SVG’s stroke-linecap, and every native 2-D API.
LineJoin
How two stroked segments meet (docs/canvas.md). Matches PDF’s j and SVG’s stroke-linejoin.
ListStyle
A paragraph’s list decoration, if it is a list item.
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, a selector on AppKit/UIKit (cut:/copy:/paste:…) or 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.
MoveVerdict
A tree move guard’s verdict (docs/tree.md). No Retarget yet: the drop vocabulary is already positional, so a guard that wants a different target denies and the user drops where it is allowed.
NavPresentation
How a navigation host lays its panes out (docs/navigation.md).
NavStyle
How a nav presents its one-of-N choice (docs/navigation.md).
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.
PaneEdge
Which side an inspector pane occupies (docs/inspector.md).
ParagraphAlign
How a paragraph’s lines sit in the width they are given.
PathSeg
One step of a Path. Points are absolute, in the canvas’s coordinate space.
PickerIdiom
Which chooser a ColorPicker opens.
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.
ReorderVerdict
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
RowFit
How a row treats content wider than the window it is in (docs/size-classes.md “Row fit policies”).
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, i.e. 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.
SearchReveal
How a navigation surface’s search field comes and goes on a phone (docs/search.md). The desktop toolbar field is always there whatever this says.
Shape
ShapeKind
A shape’s geometry, resolved against the rect layout assigns it (frame-relative, SwiftUI-style).
Space
A semantic spacing step, accepted wherever a container or modifier takes a gap or an inset in points: column(..).spacing(Space::S), .padding(Space::M); an Insets constructor takes Space::L.points().
SplitAxis
How a kinds::SPLIT lays its two panes (docs/split.md): beside each other, the divider standing, or stacked, the divider lying. Named by where the panes go, since that is what an app’s “layout” toggle means; the divider runs the other way.
StepperIdiom
Which control this stepper renders as (the colorpicker’s idiom shape).
SubmitLabel
The on-screen keyboard’s action key (text_field(..).submit_label(_), docs/textfield.md).
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.
TextAlign
How a wrapped label’s lines sit within its width (LabelProps::align).
TextVAlign
Where at sits vertically. Top, Middle and Bottom are edges of the line box (ascent + descent at the font’s size, the box Toolkit::measure_text reports); Baseline is the typographic baseline itself.
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.
ToolbarPlacement
Where an item sits on the chrome that carries it (docs/toolbars.md).
ToolbarValue
A value a toolbar item produced.
Underline
A line under a run.
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.
WidthClass
How wide a window is, in coarse buckets (docs/size-classes.md).

Traits§

AdaptiveBuilder
Builder methods of Adaptive, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
Ambient
State an ancestor provides once and any descendant reads back by type: SwiftUI’s @EnvironmentObject, and Day’s answer to “where does app state live?” (docs/state.md).
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.
AsyncImageBuilder
Builder methods of AsyncImage, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
Binding
A readable-writable value a control can bind to two-way: a Signal, or any projection that knows how to read and write its own slot (day-model’s Field is the other implementor).
ButtonBuilder
Builder methods of Button, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ColorPickerBuilder
Builder methods of ColorPicker, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ColumnBuilder
Builder methods of Column, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ComboBoxBuilder
Builder methods of ComboBox, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
CoverBuilder
Builder methods of Cover, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
DatePickerBuilder
Builder methods of DatePicker, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
Decorate
DividerBuilder
Builder methods of Divider, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
FormSectionBuilder
Builder methods of FormSection, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
GridBuilder
Builder methods of Grid, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
GridRowBuilder
Builder methods of GridRow, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ImageBuilder
Builder methods of Image, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
InspectorBuilder
Builder methods of Inspector, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
IntoElementKey
Explicit, stable canonical text for an instance key. No blanket Display conversion. Integer 42 and text “42” intentionally denote the same key. Composite keys must define an unambiguous app-owned encoding before the framework percent-escapes it.
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.
IntoImageSource
Disjoint-marker conversion into an image source (the same shape as IntoText, and for the same coherence reason): a staged name, a byte buffer, a decoded Bitmap, a Signal, or a closure all convert, each under its own marker.
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.
LabelBuilder
Builder methods of Label, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
LinkBuilder
Builder methods of Link, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ListBuilder
Builder methods of List, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ListItemBuilder
Builder methods of ListItem, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
MenuContent
Anything an app menu takes: a Vec or array of entries, or a closure that derives the entries and re-runs whenever its reactive reads change. The marker parameter is the same E0119 dodge as ToolbarContent.
Modifier
A one-shot, by-value view transform (the SwiftUI ViewModifier analog): wrap a piece into a new one. Pure composition, with 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.
NavBuilder
Builder methods of Nav, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
NavContent
What a Nav::items or Nav::section block takes: one NavItem, a tuple of them, an Option (an item the platform may not want: prefs.nav_item(key)), a Vec or array, or a data-driven nav_items block. Any mix nests: (item(..), nav_items(..), Some(item(..))).
NavStackBuilder
Builder methods of NavStack, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
NodeSource
A hierarchical row source for tree: the RowSource idea grown a parent per row. Two implementations: branches (plain data) and a day-model store’s store.tree(children_of) (feature model).
PickerBuilder
Builder methods of Picker, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
Piece
A UI description consumed once (§5.2). Returns the root realized node it created.
PieceSeq
Children of a container (§5.1): a tuple of pieces (the floem ViewTuple pattern), a Vec or array of one piece type, or an Option of a piece. Implemented for exactly those shapes, never via a blanket, to stay coherent. All of them are build-time children: evaluated once when the parent builds, with no keyed identity or reconciliation. A child that must come and go at runtime is a when, a keyed, or an each.
ProgressBuilder
Builder methods of Progress, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
PullRefreshBuilder
Builder methods of PullRefresh, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
Route
A typed route key, the compile-checked alternative to raw string keys.
RowBuilder
Builder methods of Row, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ScrollBuilder
Builder methods of Scroll, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
SearchFieldBuilder
Builder methods of SearchField, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ShapePieceBuilder
Builder methods of ShapePiece, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
SliderBuilder
Builder methods of Slider, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
Source
Anything a field can be projected out of: the store itself, one element of a keyed collection, or another field (which is how nesting works).
SplitBuilder
Builder methods of Split, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
StoreRows
store.rows(projection): the display-ordered row source for list()/each.
StoreTrees
store.tree(children_of): the hierarchical source for super::tree.
TextAreaBuilder
Builder methods of TextArea, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
TextEditorBuilder
Builder methods of TextEditor, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
TextFieldBuilder
Builder methods of TextField, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
TimePickerBuilder
Builder methods of DatePicker, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ToggleBuilder
Builder methods of Toggle, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
TreeBuilder
Builder methods of TreePiece, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
TreeConn
One tree’s live connection to its data, held for the life of the tree that connected it. All hierarchy queries are TOKEN-addressed (docs/tree.md): None = the root level.
VectorBuilder
Builder methods of Vector, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
WhenBuilder
Builder methods of When, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.
ZStackBuilder
Builder methods of ZStack, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.

Functions§

adaptive
A stack that is a row on a regular width and a column on a compact one, re-laid out (never rebuilt) as the window crosses the breakpoint, so its children keep their state. The shape a label-plus-control-plus-result line wants, where wrapping members independently would tear apart what reads as one sentence.
alert
announce
Speak text through the screen reader without moving its focus (docs/accessibility.md): the outcome of an action the user cannot otherwise learn about (“Saved”, “3 results”). The sentence waits for whatever is being read to finish; announce_urgent interrupts it. Nothing happens when no screen reader is running, and nothing happens on a toolkit that answers Cap::Announce with Unsupported.
announce_urgent
announce, interrupting what the screen reader is saying: an error, or a change that cannot wait.
app_environment
The app-wide T: created on the reactive root scope the first time it is asked for, and returned unchanged by every later call (docs/state.md).
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). Takes a list of entries or a closure that derives them.
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
async_image
Decode each source asynchronously. A replacement cancels the previous decode; disposal cancels the pending task. A failed replacement clears the previous picture.
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).
branches
Plain-data tree rows: a flat items closure, a key per item, and a parent key per item (None = a root row), as in tree(branches(model::all, |n| n.id, |n| n.parent), row_view). Children keep the items’ own relative order; an item whose parent key is absent from the set is treated as a root row rather than dropped.
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).
canvas_exports
What this toolkit can export a canvas drawing to.
capability
Query the active toolkit’s support for a capability (docs). Lets app/piece code adapt its 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
color_picker
color_picker(color) is a swatch showing color that opens a color chooser. color is a Signal<Color> or any other two-way binding (a day-model Field, mapped).
column
combo_box
combo_box(items, text): free-form text entry plus a native dropdown of suggestions. Typing (or picking an item) writes text; setting either signal patches the control.
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).
date_picker
date_picker(date): a field summoning the platform’s chooser; .inline() embeds it. date is a Signal<DayDate> or any other two-way binding (a day-model Field, mapped).
divider
dock_menu
Install the app’s Dock menu (docs/menus.md “Dock menu”): the entries macOS lists when the user right-clicks the app’s Dock icon, above the app’s [[shortcuts]] and the system’s own Show / Hide / Quit items. Probe Cap::DockMenu; elsewhere the call does nothing. Live, like app_menu: Resume <last document>, a checked “Do Not Disturb”, the locale. Install once, at startup.
document_tabs
Labels are required rather than supplying untranslated English chrome.
each
Reactive keyed collection (§5.4): keyed diff, per-key child scopes, slot rebinds for surviving rows, debug key-uniqueness assertion. Takes any RowSource.
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.
focused_environment
The ambient T of the window that currently has focus (docs/state.md): SwiftUI’s @FocusedValue.
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 Decorated::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
Draw an image from any ImageSource: a staged asset name, encoded bytes, or a decoded Bitmap.
inspector
Build an Inspector: content beside a trailing panel toggled by visible.
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, since 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 nav item: item("today", res::str::today()).icon(res::images::today).page(today_page) (docs/navigation.md). Goes into a Nav::items or Nav::section block, alone, in a tuple, or from a nav_items mapper; an item without a page is built by the nav’s Nav::destination. For a typed nav over Option<Section> pass the bare Section::X.
items
Plain-data rows: an items closure plus a key function, as in list(items(model::ordered, |i: &Item| i.id), row_view).
keyed
A subtree keyed by a value: rebuilt when the key changes, left alone while it does not (so focus and local state survive), nothing while it is None.
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 activates url through open_link when tapped.
list
Build a recycling list from a RowSource and a row builder: list(items(rows_fn, key_of), row_view) for plain data, list(store, row_view) (or list(store.rows(projection), …)) for a day-model store.
list_item
A list row’s standard content: a leading icon, a title, an optional subtitle and trailing detail, and a check mark, drawn the way the platform draws its own list rows (docs/list.md “List items”). UIKit shows it with the cell’s default content configuration, Android as a Material list item, AppKit as a table cell’s image and text, GTK as a row box; elsewhere the piece composes the same parts. Each part may follow a signal, and changes in place, so a recycled row tracks its item.
load
The three states of an async load as three subtrees (docs/async.md): the ready arm, and optional loading and failed arms (nothing is built for a state without an arm). Arms rebuild only when the variant changes; a new ready value updates the ready arm in place through Loaded::get.
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(res::str::save()).key("s").action(|| …). The title takes the same sources as a label (a literal, a localized text, a signal, a closure) and stays live.
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
nav_back
Pop one navigation level. False = nothing to pop.
nav_items
A data-driven item block: nav_items(move || st.feeds.get(), |f| item(f.id, f.name).icon(…)) (docs/navigation.md). items is a tracked reader (a Signal<Vec<T>> via its Fn() deref, or a closure); the block re-derives whenever it changes: rows are added and removed on the native sidebar/tab widget, and if the selected key disappears the selection resets (to None for an Option key). Static items and blocks may be mixed; the final list is their declaration order. A row without its own page is built by the nav’s Nav::destination.
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.
nav_stack
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_files
Start a native multi-file open picker (docs/files.md).
open_folder
Start a native folder chooser (docs/files.md).
open_link
Activate a link target, using the same policy as link and markdown labels.
open_url
Open url in the platform’s default handler (system browser for http(s), mail client for mailto:, …). The function 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.
pager
picker
picker(sort, [(Sort::Name, res::str::name()), (Sort::Date, res::str::date())]).segmented(): selected is a two-way binding to the chosen value (a Signal<T>, a day-model Field, a Mapped view), and the options are (value, title) pairs, fixed or derived from a closure. The mapping between values and the native control’s indexes lives here, once.
picker_optional
picker over an optional value: None is “nothing chosen” (no selection where the toolkit can show none), and a user’s choice writes Some(value).
piece_fn
A piece from a closure, built when the tree reaches it.
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
pull_to_refresh
Wrap child (a scroll(...) or list(...)) with pull-to-refresh bound to refreshing.
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-mdc’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, so 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
search_field
search_field(query): a native search input whose text mirrors query in both directions; query is a Signal<String> or any other two-way binding (a day-model Field).
section
A grouped card of form rows; .title(…) adds the header. Works inside a form (shared label column) or standalone.
secure_field
A password field: a text_field that hides its characters and tells the platform it holds a password, so the password manager offers to fill it (docs/textfield.md).
segment
A segment showing label; add .icon(…) for the platforms that draw one.
set_locale
Switch the locale at runtime; every tr/binding re-runs.
set_log_level
Raise or lower the level Day’s default logger emits, at runtime. DAY_LOG sets it at startup on native targets; the web launch path reads ?DAY_LOG= from the page URL. Set the maximum level that will be emitted. Separate from init_logging because the web launch path has to supply the level from the page URL rather than the environment, and because an app may want to raise or lower it at runtime.
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, so 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).
size_class
The current window’s size class, or None on a backend that does not report one yet. Tracked: a piece that lays out from this rebuilds when the window crosses a breakpoint.
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.
split
Build a Split: first beside (or above) second, divided at half until dragged.
status_item
Show a status item (docs/status-item.md): an icon in the macOS menu bar, the Windows notification area, or a Linux tray. build runs now and again whenever a signal it reads changes, so a timer’s title or a “Pause sync” check mark follows the app’s state. id names the item; showing a second item with the same id replaces the first.
stepper
stepper(value): a numeric field with increment/decrement arrows. value is a Signal<f64>, a day-model Field, or any other two-way binding; a step click commits one unit through it (write_commit), so under an undo stack each click is one undoable step.
sub_menu
A nested submenu: sub_menu(res::str::menu_file(), vec![menu_item(…), …]).
swipe_action
Build a swipe action with label (a literal, a res::str::… text, a signal or a closure; resolved in the current locale each time the offer is pulled). Chain destructive or tint for styling and action for the work; an action without a handler still reveals and dismisses, but does nothing.
switch
One tracked read, one arm (docs/state.md): a subtree per value of selector, rebuilt when the value changes. The arm closure usually matches, so its arms erase with .any():
text_area
text_area(text): a native multi-line editor whose contents mirror text in both directions; text is a Signal<String> or any other two-way binding (a day-model Field).
text_editor
text_editor(doc): the platform’s rich-text view over a StyledText signal.
text_field
time_picker
time_picker(time): a field summoning the platform’s chooser; .inline() embeds it.
toggle
toolbar_button
A push button: toolbar_button(day_core::id!(refresh), tr("refresh")).icon(Symbol::Refresh).action(…).
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_segmented
A row of mutually exclusive choices as one native control (docs/toolbars.md): the platform’s segmented control, bound to selected.
toolbar_separator
A divider, where the platform draws one (macOS toolbars have none, so AppKit renders it as a fixed gap; docs/toolbars.md). It takes an id like every other item: an id is an item’s identity on the bar, which is what lets Day add and remove one item at a time.
toolbar_toggle
A two-state button bound to on (a Signal<bool> or any other binding): the user flipping it writes the binding, and writing the binding restyles the button.
tr
tree
Build a hierarchical tree from a NodeSource and a row builder: tree(branches(items_fn, key_of, parent_of), row_view) for plain data, tree(store.tree(children_of), row_view) for a day-model store.
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: a “load whatever is selected” reaction has to run once by hand first, or use bind, which applies the initial value and then every change.
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, Vec or array of children.

Derive Macros§

Observable
Per-property observation for a struct; see day-model’s crate docs and docs/model.md.