Expand description
Re-exports§
pub use fenestra_kit as kit;pub use fenestra_shell as shell;
Modules§
- by
- Query constructors, in the order you should prefer them.
- canvas
- The canvas substrate: camera, zoom, snapping, and zoom-compensated stroke math for pan/zoom canvases (Figma/tldraw-class tools). Pure geometry — no rendering, no state — so it composes with the element tree and runs headless. Constants follow tldraw’s defaults.
- effects
- Generated effect fields: deterministic RGBA8 textures for the “bespoke” end
of the design system. The inputs (size, color points, seed, intensity)
tokenize; the output is a pixel buffer you hand to
image_rgba8. Pure and deterministic, so these golden-lock like everything else in fenestra. - optical
- Optical adjustments: the small geometric corrections that make shapes look right even though they measure “wrong”. The eye weighs the area near a shape’s boundary, so a circle must be slightly larger than a square to read as the same size, and an asymmetric shape (a play triangle) must be centered on its visual mass (centroid), not its bounding box. (bjango optical adjustments; Rauno’s interface guidelines.)
- prelude
- Commonly used items: builders, tokens, widgets, and the runner.
Structs§
- Access
Node - One node of a frame’s accessibility projection (see
Frame::access_tree): plain data, usable headlessly in tests and mapped to AccessKit by the windowed shell. - Adaptive
Tint - Backdrop-adaptive vibrancy for a glass material. In the headless two-pass
renderer — where the frosted backdrop image is in hand at paint time — the
painter measures the mean luminance of the blurred crop behind the pane and
shifts the tint’s OKLCH lightness toward white over dark backdrops and toward
black over light ones, so the frosted surface keeps a stable contrast against
whatever floats behind it. This is Fluent Acrylic’s “luminosity clamp” idea
reduced to a single mean-luminance lightness shift (Apple Liquid Glass does
the same tonal adaptation, without a published formula).
None(the default) keeps a fixed tint, so non-glass elements — and the single-pass live window, which has no backdrop image — stay byte-identical. Set bySurface::Glass. - Base
Field - The neutral-field character for
Theme::derive: the hue the neutral ramp is tinted with and how far it departs from gray.chromamultiplies the neutral table’s (very low) base chroma —1.0is the stock near-gray SaaS tint,4–10an atmospheric duotone field (deep green, warm paper),0pure gray. - Border
- A border stroke: a width and color. Apply it to every edge with
Style::border, or to a single edge withStyle::border_topand friends (carried per-edge byEdgeBorders). - Breakpoints
- Yes/no width queries against the
Breakpointthresholds — the boolean counterpart ofBreakpoint::at, forview_at/responsiveconsumers that want a flag rather than a band. A zero-sized namespace, never constructed. - Catalog
- A message catalog: keys mapped to translated strings with
{name}placeholder interpolation. A missing key falls back to the key itself, so a view never renders blank. - Contrast
Violation - A text/background pair that failed its APCA Lc floor during
Theme::validate_contrast. - Corner
Radius - Per-corner radii in logical pixels.
- Cubic
Bezier - A cubic bezier easing curve
(x1, y1, x2, y2), CSS-style:x1/x2are clamped to0..=1by convention (a monotone x-curve) buty1/y2may leave that range for an overshoot curve. - Derive
Spec - The three-input parameters of a
ThemeSpec(Theme::derive). - Dispatch
- The result of dispatching one event.
- Duotone
Spec - The duotone parameters of a
ThemeSpec. - Edge
Borders - Per-edge border strokes (top/right/bottom/left), each optional and
independent of the uniform
Border. Drawn as straight hairlines with square corners — for a rounded full edge useStyle::border. Lets hairline-divided layouts (a header’s bottom rule, a left accent rail, a table’s ruled rows) skip manual 1px divider children. - Edges
- Per-edge values (padding, margin, inset).
- Element
- One node in the view tree.
Msgis the app’s message type; handlers carryMsgvalues, not closures over state. - Exit
Anim - How an element animates out when it leaves the tree (the counterpart of
Element::enter). When an element tagged withElement::exitis removed, a paint-only snapshot (“ghost”) is left in its place and animates toward these targets overtransition, then is dropped — there is no live widget behind it (inputs collapse to a plain box). Inert under reduced motion: the element is removed immediately, so headless renders are unchanged. - Focus
Ring - The focus-ring spec (shadcn v4 model). On keyboard focus a control swaps
its border to the ring color and draws a soft halo
widthpx wide atalpha,offsetpx outside the border (0 = flush). The ring color is the accent by default and the danger hue when the control is marked invalid. Painted only when focus arrived via keyboard (crate’sfocus_visible). - Font
Features - A typed set of OpenType features applied to a text run. Orthogonal axes:
figure shape (
figures) and figure spacing (spacing) compose freely (e.g. tabular + old-style is valid), small caps, standard ligatures, and fractions are independent toggles. The default enables nothing, leaving every glyph at the font’s own defaults. Built into a CSSfont-feature-settingsstring for parley; part of the layout cache key. - Fonts
- The font system: a fontique collection with the embedded Inter family, parley contexts, and the layout cache. One per app (or per test process).
- Frame
- A laid-out frame: resolved styles and absolute rects for every element. Paint, input routing, and debug dumps all read from this one structure.
- Frame
State - Retained state for one UI surface (window or headless session).
- From
Iter - Marker for the iterator family (see
IntoChildren). - From
Tuple - Marker for the tuple family (see
IntoChildren). - Gradient
Stop - A gradient color stop: offset 0.0..=1.0 and a color.
- Grid
Lines - A named-line placement on one grid axis: the start and end line names
(CSS
grid-column: a / b). Empty by default — numeric/auto placement. Names resolve against the parent grid’sgrid-template-areas(<name>-start/<name>-end) and explicit line names. - Grid
Place - Grid item placement on one axis.
- Image
Data - Payload for
Kind::Image. - Input
Data - Payload for
Kind::Input. - Inset
- Optional per-edge offsets for positioned elements.
- KeyInput
- A key press with modifiers.
- Keyframes
- A looping keyframe timeline: style stops at fractional times across one
period, sampled from the frame clock every frame. Built for ambient
motion (pulses, shimmers, breathing); one-shot state changes belong to
Transition. With reduced motion the first stop is pinned, keeping headless renders deterministic. - Locale
- A locale: a BCP-47-ish language tag plus the writing direction and the
decimal / grouping separators used to format numbers. Construct with
Locale::new(which infers everything from the tag) or tune the separators with the builders. - Material
- A translucent “frosted glass” material (Apple “materials” / Linear &
Raycast command palettes): a pane that reads as floating glass over the
content behind it. Describes the three perceptual levers of glass — how much
shows through (
fill_alpha), how strongly the content behind would be blurred (blur_radius), and how much the wash-out is re-saturated (saturation, “vibrancy”). Resolved against aTheme(never a raw color) byMaterial::tint, and carried by aSurfaceBundlevia theSurface::Glassrole. - Memory
Clipboard - The default in-memory clipboard (headless tests use this).
- Multi
Pass Spec - One region the shell must filter out-of-band, recorded during the backdrop
walk and keyed back to its element by
id. - Nav
- A non-empty stack of routes. The bottom entry is the root and is never popped,
so
currentis always valid —Navcannot be empty. - Optical
Correction - Optical corrections for a
Kind::Path(seecrate::optical): geometric nudges that make a shape look right even though it measures “wrong”. Both default to off, so a path renders byte-identically until opted in — set them per icon where the shape needs it, rather than auto-detecting (which would silently shift every existing icon). - Overlay
- Marks an element as an overlay child of its parent (the anchor): excluded from normal layout, laid out against the canvas, painted after the root, and hit-tested first.
- Path
Data - Path payload for
Kind::Path. - Proxy
- Delivers messages into the running app’s
updatefrom any thread: background work, timers, IO completion. Cloneable and cheap; apps receive one incrate::App::initand move clones into threads. - Query
- A semantic query against the frame’s accessibility tree. Build one
with the
byconstructors; refine role queries withQuery::name. All set criteria must match (AND). - Radius
Scale - A corner-radius family derived from one base measure, so a theme can be
tighter or rounder from a single knob. The ratios (0.6 / 1.0 / 1.4 / 2.0 ×
base) are fenestra’s: a base of
10reproducesR_SM/R_MD/R_LG/R_XLexactly, which is why the kit’s constants and the default scale agree. - Ramp
- A 12-step color ramp.
- Shadow
- One drop shadow layer.
- Sheen
- A directional body sheen across an element’s face — the raking light that
makes a translucent pane read as lit glass instead of a flat, uniform tint.
A soft gradient wash, white at the end facing the light (top-left) grading
through transparent to an optional faint shade at the far end, source-over
the fill and clipped to the rounded silhouette.
None(the default) paints no sheen. Pairs withSpecularEdge; both are set bySurface::Glass. - Span
- One styled run of a
rich_textparagraph. Unset properties inherit the paragraph’s text style. - Specular
Edge - A luminous specular edge rim — the iconic Liquid Glass perimeter light. A
directional highlight that wraps the whole rounded silhouette, brightest on
the edge that faces a fixed light (the top, by default) and fading toward the
far side, so a translucent pane reads as lit, lensed glass rather than a flat
outline. Painted as a gradient-brushed stroke just inside the silhouette,
over an optional faint dark inner contact line that gives the rim a sense of
thickness (the “double edge”).
None(the default) paints no rim — every non-glass element stays byte-identical. Set bySurface::Glass; layered over the flathighlight_topbar on glass (both are painted). - Spring
Spec - Spring parameters for physical motion.
- State
Layer - The Material state-layer recipe: a translucent veil of a control’s content color, laid over its container to signal interaction — one set of opacities shared across the whole kit instead of per-widget hover colors. Hover is the lightest; focus and press share a stronger value; an in-progress drag is strongest. Disabled is expressed separately as a faint container plus dimmed content rather than an overlay.
- Status
Colors - The resolved colors of one status hue: tinted background, border, solid fill with its hover and pressed variants, and text.
- Style
- The complete style of an element: layout, paint, and text groups.
- Surface
Bundle - The role-resolved description of a
Surface: radius, fill/border roles, shadow token, optional top-highlight alpha, and an optional translucentMaterial.Surface::bundlereturns it (pure, no theme — so radius/shadow/role ordering is unit-testable);SurfaceBundle::applyturns it into a concreteStyle. Public so apps and Looks can compose custom materials from the fill/border roles. - Text
Legibility - One text node’s legibility, measured on the real resolved colors and size —
produced by
Frame::legibility. Reports both the APCALcand the WCAG 2 ratio against the floor each standard sets for the rendered size, so an agent can prove a screen is readable without looking at a single pixel. - Text
Style - The text style group.
color,line_height, andletter_spacingdefault to the theme/text-size tokens whenNone. - Theme
- Design tokens resolved for one color mode.
- Theme
Spec - A serializable theme recipe: the few numbers a theme generates from, not hundreds of resolved colors — so files stay tiny, stable across fenestra versions, and hand-editable.
- Transition
- Declares which properties animate between style states, and how.
- Virtual
Data - Payload for virtualized rows (
Element::virtual_rows): only the scrolled-into-view window of rows is materialized each frame. - Widget
Id - A stable identity for one element in the tree.
- Window
Desc - A secondary window the app wants open: presence in
App::windows’s list opens it, removal closes it (exactly like modal state). The OS close button emitson_close— remove the desc inupdateto actually close. - Window
Options - Options for the application window.
Enums§
- Align
Content - Multi-line content alignment (flex wrap / grid).
- Align
Items - Cross-axis alignment of children.
- Breakpoint
- The named width bands from Tailwind, mobile-first (smallest to largest).
Self::atclassifies a logical-pixel width into the largest band whose minimum width it meets. - Chrome
Elevation - The editor-chrome elevation vocabulary — Figma’s flat, layered panel
shadows: two soft black drops over a 0.5px hairline ring. Flat and
mode-independent (true black at low alpha), in deliberate contrast to the
hue-tinted, themed
ShadowTokenused for product surfaces. The ring is a 0.5px shadow spread (no blur), which the painter renders as a crisp sub-pixel edge. - Chrome
Text - Editor-chrome text sizes — the dense panel type, 11–14px, distinct from the
product
TextSizescale (which starts at 12px for reading text). 11px is the base for nearly all panel/inspector text. Apply through the free-form size override:text(..).size_px(ChromeText::Sm.px()).tracking(ChromeText::Sm.tracking()). - Contrast
- Contrast level for
Theme::derive: scales every neutral step’s lightness distance from the background, so text and UI separation widen or soften from one knob.Standardreproduces the stock ramps exactly. - Cursor
- Mouse cursor shown while hovering an element.
- Direction
- Main axis direction of a flex container.
- Display
- Display mode of a box.
- Drawer
Side - Which screen edge a drawer/sheet overlay is anchored to.
- Element
Filter - A foreground filter applied to an element’s own rendered content (CSS
filter:), as opposed toStyle::backdrop_blurwhich filters what shows through a translucent element. Resolved by the shell’s two-pass renderer: the element’s pixels are read back, filtered on the CPU (deterministically), and composited in place. Each variant carries one lever in logical px (blur radius) or as a unit multiplier (1.0= identity). - Elevation
- How resting, same-plane surfaces (cards) convey separation. Floating
surfaces — menus, popovers, modals, tooltips — always cast a shadow; this
only governs cards that rest in the page. Set on a theme with
Theme::with_elevation. - Family
Role - Font family roles resolved through fontique.
- Figure
Style - Figure (numeral) shape. Old-style figures have varying heights and
descenders that sit naturally in serif prose; lining figures are
uniform cap-height digits for data and UI.
Defaultleaves the font’s own default figures untouched. Maps to theonum/lnumOpenType features. - Grid
Template - One entry of a grid template: a single
Track, or arepeat(...)of tracks (including the responsiveauto-fit/auto-fill). Build aVec<GridTemplate>withStyle::grid_cols/Style::grid_rows, which also accept plainTracks (each wrapped asGridTemplate::Single). - Input
Event - A logical input event, shared by the windowed runner and headless
SyntheticEventinjection. - Justify
Content - Main-axis distribution of children.
- Key
- A logical keyboard key (expanded for text editing in M5).
- Kind
- What an element fundamentally is.
- Length
- A length value for sizes and flex basis.
- Mode
- Light or dark color mode. Both are always generated from the same hue.
- Motion
Duration - Motion duration tokens, in milliseconds. Interaction feedback lives in the
100–200ms band; larger surfaces take longer. Exits are quicker than the
matching entrance (see
MotionDuration::exit_ms). - Numeric
Spacing - Figure spacing. Proportional figures are individually spaced for prose;
tabular figures share one advance so columns of numbers align and values
that update in place don’t jump.
Defaultleaves the font’s own spacing. Maps to thepnum/tnumOpenType features. - Optical
Sizing - How the
opsz(optical size) variation axis of a variable font is set. Optical-size masters are drawn for a size range: fine, high-contrast cuts at large display sizes and sturdier, more open cuts at small text sizes, so a face looks right across the scale instead of one master scaled up and down. Maps to CSSfont-optical-sizing/ theopszfont-variation-settingsaxis. - Overflow
- Overflow behavior per axis.
- Overlay
Mode - How an overlay child opens and closes.
- Overlay
Placement - Where an overlay is positioned.
- Paint
- Background paint.
- Pass
Kind - The operation a
MultiPassSpecapplies to its region’s pixels. - Position
- Positioning scheme.
- Query
Error - Why a strict lookup failed — the non-panicking form used by machine-driven harnesses (scenario scripts).
- Repeat
- How many times a
repeat(...)fragment is generated. - Semantics
- Accessible role and state of an element, projected into the platform
accessibility tree by the shell (AccessKit) and exposed headlessly via
Frame::access_tree. Text, image, and input leaves project automatically; kit widgets set the rest. - Shadow
Token - Shadow elevation tokens. Resolved to concrete layered shadows by the
theme (dark mode multiplies alphas by 1.6). Ordered by depth
(
Xs < Sm < Md < Lg < Xl, in declaration order) so elevation roles can be compared — e.g. a floating surface’s shadow must out-rank a resting one’s. - Surface
- One of the kit’s elevation materials: a semantic role that bundles a
corner radius, a fill role, a border role, a shadow token, and an optional
top highlight into one typed primitive, resolved against a
Themeinto aStyleoverlay. Floating roles (Popover/Menu/Modal/Glass) carry radii>=and shadow depth>=the resting roles (Card/Raised), so “every floating thing matches” is structural, not a convention re-typed at each call site.Thumb(a control handle) andTooltip(an inverted chip) are deliberately exempt from that ordering. - Surface
Border - The border role of a surface bundle.
- Surface
Fill - Which theme role a surface fill resolves to — a bundle is defined in semantic roles, never literal colors.
- Surface
Radius - The corner-radius shape of a surface bundle: one
Uniformradius on every corner. A nested rounded child derives its concentric radius from this viaSurfaceRadius::inner(passing the padding between them). The enum is#[non_exhaustive]to leave room for future shapes (e.g. per-corner radii). - Swipe
Dir - A recognized swipe (flick) direction, delivered by
Element::on_swipe. Screen axes:Downis toward the bottom. - Text
Align - Horizontal text alignment.
- Text
Match - How a text criterion matches an accessible string.
- Text
Size - The typographic scale. Sizes are logical px.
- Text
Wrap - How text is broken into lines once shaping has wrapped it at the available width. parley line-breaks greedily (each line is filled as full as it can be); these modes refine that result by re-wrapping at a narrower width that the framework searches for. Part of the layout cache key (so a mode flip is never cached away).
- Track
- A grid track size — CSS
<track-size>.PxandFrare the common cases;MinMaxplus the content keywords cover responsive templates. - Track
Max - The
maxargument of aTrack::MinMax— a track’s ceiling. - Track
Min - The
minargument of aTrack::MinMax— a track’s floor. A floor cannot be flexible, so there is nofrhere (CSS forbids it). - Weight
- Font weights shipped with the embedded Inter family.
- Writing
Dir - Writing direction for the UI — left-to-right (the default) or right-to-left.
Set on the
Theme(Theme::rtl); underRtlthe realized layout is mirrored horizontally andstart-aligned text flips to the right edge.
Constants§
- DEFAULT_
CORNER_ SMOOTHING - The stock kit-wide corner smoothing:
0.6blends every rounded surface into an Apple-style squircle (continuous-curvature corners) instead of a plain circular arc. Calibrated by eye as the point where the squircle reads clearly without over-squaring small controls; set0.0for exact circular corners viaTheme::with_corner_smoothing. - EASE_
ACCELERATE - Accelerate easing for exits (Material 3): (0.4, 0, 1, 1) — easing away,
then leaving briskly. Pair with
MotionDuration::exit_ms. - EASE_
DECELERATE - Decelerate easing for entrances (Material 3): (0, 0, 0.2, 1) — quick to arrive, easing to rest. Pair with an entrance transition.
- EASE_
EXIT - Exit easing; the historical name for
EASE_ACCELERATE. - EASE_
IN_ OUT_ CUBIC - Symmetric ease for camera moves and large surface transitions (CSS
easeInOutCubic): (0.65, 0, 0.35, 1). The canvas camera (crate::canvas) eases zoom-to-fit and zoom-to-selection with it — the curve Figma and tldraw use for canvas motion. - EASE_
STANDARD - The Material 3 easing families. Use
EASE_STANDARDfor two-way state changes (hover, press, color),EASE_DECELERATEfor entrances (an element flying in and settling), andEASE_ACCELERATEfor exits (an element leaving the screen). Entrances ease out (fast then gentle); exits ease in (gentle then fast) so they clear quickly. - FOCUS_
RING - The focus ring token: a 3px halo at 0.5 alpha, flush outside the border.
- GLASS_
LIGHT_ DEG - The fixed light azimuth for the glass specular rim, in CSS gradient degrees
(
0= up,90= right). fenestra puts the light at the top so a floating glass pane catches light along its upper edge and shades toward the bottom. Used bySpecularEdge::glass; the bodySheenrakes from the upper-left on its own diagonal axis. - GRADIENT_
STEPS - Sub-segments generated per anchor pair when expanding an OKLCH gradient
(
linear_gradient/radial_gradient). Calibrated so a full hue-arc ramp shows no perceptible banding once vello resamples the stops into its ~512-texel sRGB ramp LUT (≈32 texels per sub-segment at 16). A perceptual target, not a hard spec number: raise it if a wide-hue ramp ever bands at a sub-segment joint. - MAIN_
WINDOW - The key
App::view_forreceives for the main window. - MEASURE_
CH - The default reading measure, in CSS
chunits (1ch = the advance of the digit'0'; seecrate::Length::Ch). Set to 52 so a proportional body face renders ~66 characters per line — the classic optimum for sustained reading (the comfortable band is 45–75). The value is below 66 on purpose:'0'is wider than the average glyph, so a column of Nchholds somewhat more than N real characters; 52ch lands the rendered line near 66. A wider face fits fewer characters per line, a narrower one more. Prose containers cap their width here viacrate::Style::measure. - PRESS_
SCALE - Pressed controls scale to this factor for tactile press feedback (Material 3 uses 0.96–0.97). Applied as a paint-time transform about the control’s center, so it never disturbs layout or hit-testing, and it animates through the same transition as the press color.
- R_FULL
- Fully-rounded (pills, avatars); clamped to half the box size at paint.
- R_LG
- Large radius (cards): 14px.
- R_MD
- Medium radius (controls: buttons, inputs): 10px.
- R_SM
- Small radius (badges, small chips): 6px.
- R_XL
- Extra-large radius (modals): 20px.
- SP0
- Spacing constants on a 4px grid, in logical pixels.
- SP0_5
- 2px.
- SP1
- 4px.
- SP2
- 8px.
- SP3
- 12px.
- SP4
- 16px.
- SP5
- 20px.
- SP6
- 24px.
- SP8
- 32px.
- SP10
- 40px.
- SP12
- 48px.
- SP16
- 64px.
- STATE_
LAYER - The state-layer token.
Traits§
- App
- An application: state, a pure view of it, and a message-driven update.
- Clipboard
- Read/write access to a clipboard.
- Into
Children - Anything that can become a child list. Implemented for every
IntoIteratorof oneInto<Element>type (vecs, arrays,mapchains) and for tuples of up to twelve differentInto<Element>types.Markerdisambiguates the two families; let inference fill it.
Functions§
- build_
frame - Lays out an element tree into a
Frameat the given logical size and DPI scale. A root withAutowidth/height is stretched to the canvas. - build_
scene - Convenience: lays out and paints in one call with throwaway state.
- click_
msg_ of - The message an enabled element with the given id would emit when
clicked, if any. The shell uses it to honor accessibility action
requests (AccessKit
Action::Click) without synthesizing pointer events. - col
- A flex column.
- conic_
gradient - A conic (sweep)
Paint(seePaint::ConicGradient) centered atcenter(unit coordinates within the element rect), sweepingcolorsonce around the full circle as a smooth OKLCH ramp (oklch_stopswithGRADIENT_STEPS). Fewer than two colors collapse to a solid fill. Reads from theme tokens — never a raw hex literal. - dispatch
- Dispatches one event against the last laid-out frame, updating retained interaction state and collecting emitted messages.
- div
- A plain container box (flex row by default, like taffy).
- divider
- A horizontal hairline rule in
border_subtle, 1px tall and full width. For a vertical rule, override with.w(1.0)and.h_full(). - frame_
epoch - The current frame-build epoch: the number of the frame
build_frameis currently (or most recently) laying out. It is bumped once per frame, before the tree is walked — so the lazy row builder of a virtualized container (Element::virtual_rows), which runs during the walk, can key a per-frame scratch budget off it: work a row does on materialization (e.g. decoding an image) is then bounded once per frame across all the rows the window covers, instead of resetting per row (which lets a tinyrow_heightcollapse the window onto every row, each with a full, independent budget). Returns 0 before the first frame has been built. - image_
from_ data - An image leaf rendering an already-decoded
ImageDatapayload (fromimage_payload), sized to it. Building many elements or frames from clones of one payload shares a single reference-counted pixel blob, so a decoded-image cache never re-decodes or re-copies. Seeimage_rgba8for the owned-Vecconvenience wrapper. - image_
payload - Package already-decoded straight-alpha RGBA8 pixels (row-major, 4 bytes per
pixel) into a shareable
ImageData: the buffer becomes an atomically reference-counted blob, so cloning the result and handing it toimage_from_datashares the one allocation instead of re-decoding or copying — the reuse path a decoded-image cache wants. Ifpixelsholds fewer thanwidth * heightcomplete rows, the payload shrinks to the rows provided (itsheightreflects that), matchingimage_rgba8. - image_
rgba8 - An image leaf showing straight-alpha RGBA8 pixels (row-major, 4 bytes
per pixel). Sized to the image by default, stretched when styled
otherwise, and painted clipped to the corner radius — so
.rounded_full()crops a square source into a round avatar. Ifpixelsholds fewer thanwidth * heightcomplete rows, the element shrinks to the rows actually provided instead of panicking. - lc
- APCA
Lcfortextpainted overbg. Positive for dark-on-light, negative for light-on-dark; the magnitude (0..~108) is the perceptual contrast. - lc_abs
- The magnitude of
lc— the form used by “meets a target” checks, which care about contrast strength, not polarity. - linear_
gradient - A linear
Paintwhosecolorsare spaced evenly across0.0..=1.0and expanded into a perceptually smooth OKLCH ramp (oklch_stopswithGRADIENT_STEPS).angle_degis CSS-style (0 up, 90 right). Reads from tokens, e.g.bg(linear_gradient(135.0, [t.accent, t.accent_text])). Fewer than two colors collapse to a solid fill (one color, or transparent for none). - meets
- Whether
textonbgreaches anLctarget (by magnitude). - oklch
- Builds an sRGB
Colorfrom OKLCH (lightness 0..=1, chroma, hue degrees), gamut-mapping by reducing chroma — never lightness — when the color is out of gamut. This is the framework’s color primitive: theme ramps, Looks, and data-viz palettes are all built from it, so a generated color is always in-gamut and keeps its intended lightness. - oklch_
of - The OKLCH components
[L, C, H]of a color — the inverse ofoklch. Hue is0.0for achromatic colors (where it is otherwise undefined), so the result round-trips cleanly back throughoklch. Use it to adapt an existing color (e.g. lift a categorical swatch for a dark background). - oklch_
stops - Expands OKLCH-interpolated color stops between anchor colors. Each adjacent
anchor pair is walked in
stepssub-segments through OKLCH (shortest hue arc, achromatic-endpoint handling, gamut-clamped — the exact OKLCH lerp the transition engine animates colors along), so the rendered ramp stays perceptually even with no desaturated “gray dead-zone” through the middle of a wide-hue transition. The vello renderer interpolates the returned stops in sRGB, but they sit densely on the OKLCH curve, so the on-screen ramp tracks it. Anchors are(offset, color)with offsets in0.0..=1.0; they are sorted ascending and the endpoints are preserved exactly. Colors must come from theme tokens oroklch/oklch_of— never a raw hex literal. - path
- A vector path drawn in
viewboxcoordinates and scaled to the element rect (sized to the viewbox by default).strokeis a width in viewbox units;Nonefills instead. Painted in the resolved text color. - radial_
gradient - A radial
Paint(seePaint::RadialGradientforcenter/radius) whosecolorsare spaced evenly across0.0..=1.0and expanded into an OKLCH ramp (oklch_stopswithGRADIENT_STEPS). Fewer than two colors collapse to a solid fill (one color, or transparent). - raw_
input - A bare single-line text input leaf. Most apps want the styled
fenestra_kittext_inputinstead; this is the primitive it wraps. Focusable, shows the text I-beam, and emitson_inputper edit. - raw_
text_ area - A bare multiline text area leaf: text wraps to the element width, Enter
inserts a newline, arrows move by line, and the measured height grows
with the wrapped content (constrain it with
.min_h/.max_hplus an outer scroll container). Most apps want the styledfenestra_kittext_areainstead; this is the primitive it wraps. - refresh_
hover - Recomputes the hover set against a freshly-built frame without emitting
messages — used after scrolling moves content under a stationary
pointer. Returns
truewhen the hover set changed. - required_
lc - The minimum APCA
Lcmagnitude that text ofsize_pxlogical pixels at fontweight(OpenType 100..900) needs to be read fluently — APCA’s readability criterion as a function instead of a fixed floor. Smaller and thinner text needs more contrast; larger and heavier text needs less. - responsive
- A container that chooses its own layout from its measured size — a
container query, the counterpart of window-size
App::view_at.f(available)receives this container’s own content size in logical px from the previous frame (the layout the motion system already records) and returns the element to lay out in its place. - responsive_
hinted responsivewith an explicit first-frame size:f(hint)builds the initial frame (before any measurement exists), removing the one-frame “smallest branch” flash when the rough size is known up front. Seeresponsivefor the convergence model and the identity / monotonicity caveats.- rich_
text - A paragraph of styled runs: spans wrap together as one layout, and
each
spanmay override weight, color, size, family, or italic. - row
- A flex row.
- run
- Opens a window and runs the app until the window closes.
Msg: SendbecauseApp::init’s proxy delivers messages across threads. - spacer
- Flexible empty space (flex grow 1).
- span
- A styled run for
rich_text. - stack
- A z-stack: children occupy the same rect and paint in order.
- text
- A text run.
- tracking_
em - Optical tracking (letter spacing) in em for a font size in logical px,
from Inter’s published dynamic-metrics formula
-0.0223 + 0.185·e^(-0.1745·px): a hair positive at caption sizes, tightening smoothly as text grows. Applies to any size, including free-form display sizes, instead of a handful of hand-set steps. - wcag2_
passes - Whether
textonbgclears the WCAG 2 AA threshold:4.5:1for normal text,3.0:1for large text (large = true: >= 18pt, or >= 14pt bold). - wcag2_
ratio - The WCAG 2 contrast ratio between two opaque colors:
(L1 + 0.05) / (L2 + 0.05)with the lighter luminance on top. Ranges from1.0(identical) to21.0(black on white). APCA (lc) models perception better, but WCAG 2 is the shipping legal standard, so the verification surface reports both.