# kui props, elements, events and warnings

*Generated by `npm run gen` in `packages/kui` from the tables in
`crates/kui-core/src/schema.rs` and `crates/kui-core/src/diag.rs` — edit
those, not this file.*

One prop schema serves every binding: JSX props are camelCase, Lua keys are
their snake_case, C uses the `KuiSpec` / `KuiTextStyle` field named
below, and Odin the `Spec` / `Text_Style` field of the snake_case name
(packages/odin, whose generator checks every Odin spelling in this file). Container props apply to `<box>` (and to `<edit>` / `<image>`
where they make sense); text props apply to `<text>` and `<edit>`.

## Container props

| JSX | Lua | C | Odin | type | description |
|---|---|---|---|---|---|
| `accent` | `accent` | `accent` | `Spec.accent` | boolean | Paint this node's background in the OS accent colour — `env.system.accent` — keeping the declared `bg` on a host that cannot tell what it is. The one prop whose paint depends on the environment, which is why it is opt-in: the same tree is a different colour on two machines, and that is the point here and a surprise anywhere else. On the stock button it does the whole job — the hover and pressed shades are derived from the accent, and the label goes black or white by its luminance, so a yellow accent is still readable — which is what `<button accent>` is for. |
| `activeIndex` | `active_index` | `active_index` (a borrowed `KuiValue*` holding a whole number; NULL for none) | `Spec.active_index` | message (any plain data) | On a windowed `list` or `table` composite (ADR 0070): the data row (a whole number, its `index`) Tab enters it on — the selected one after a reload — scrolled to and landed on when the frame did not build it. Wins over the row the composite remembers focus last held there; without either, ADR 0007's entry (`initialFocus`, `selected`, the first row). A value that is not a whole number is no row. |
| `anchor` | `anchor` | `anchor` | `Spec.anchor` | boolean | Scroll anchoring on a scrolling node (backlog C26, CSS's `overflow-anchor`): the first child in view keeps its place on screen when the content before it changes size — a chat that prepends history, a log that inserts rows above the viewport, a list whose row heights are corrected as they are measured — with no `setScroll` and no arithmetic in the view. The core remembers which child was first in view and where its edge was, and moves the offset by however far that edge moved in the next layout, before the offset is clamped; a wheel notch or a `setScroll` between the frames is kept and the correction added to it. The child is found by key, so give the rows stable keys (a `key` or an `index`); a child that is gone anchors nothing that frame. On the scroll axis that is the node's main axis only — `scrollY` on a column, `scrollX` on a row — and content appended *after* the anchor moves nothing — unless the last layout left the node at its end (with somewhere to scroll) and nothing has scrolled it since: then it is kept at its end in the same frame, whatever grew or shrank, its own box included, so a tailing log stays tailing without asking each frame. A wheel notch, a drag or a `setScroll` away from the end stops that until the node is at its end again. |
| `animate` | `animate` | `animate` | `Spec.animate` | boolean | Ask for another frame after this one, every frame this node is declared. What a `fragment` that reads `time` needs, and what anything driving itself off the clock rather than off input needs. Opt-in like `exit`, and for the same reason: it takes the loop off input-driven and onto the display's cadence for as long as it is declared, so a still node must not carry it. One node asking is enough for the whole window. |
| `aspectRatio` | `aspect_ratio` | `aspect_ratio` | `Spec.aspect_ratio` | number, or a `"$length"` token | Width over height — `16/9`, `1` for a square — CSS's `aspect-ratio`. It sizes the axis left `fit`: a fit height is the final width over the ratio (so `width: grow` and a ratio is a box that keeps its shape as the window resizes), and a fit width under a fixed height is that height times it. With both axes declared, or a fit width under a `grow` or percent height, it has nothing it can set and warns. The derived axis is neither shrunk nor fitted to the children, which overflow it; `minHeight: 'fit'` floors it at them. On an image it wins over the pixels' own aspect. |
| `backdropBlur` | `backdrop_blur` | `backdrop_blur` | `Spec.backdrop_blur` | number, or a `"$length"` token | Blur what was drawn beneath the node, inside its rounded box, by this radius in logical px — CSS's `backdrop-filter: blur()`, the radius its standard deviation (backlog F129). What blurs is everything painted before the node: its ancestors' backgrounds, the siblings under it, content scrolling beneath it, the window's `backdrop` where the window has one. The node's own `bg`, border and children paint over the blur, so a translucent `bg` (`#ffffff40`) makes frosted glass and an opaque one hides it. Clipped as the node is, faded by its `opacity`; 0 is none. The GPU renderer reads back only the box (and a margin of three radii around it) and blurs it at reduced resolution, so it costs a copy and three small passes per blurred node on a frame that has one and nothing on a frame that does not. A renderer that cannot read back what it drew — a host's own, or anything older — leaves the node over an unblurred backdrop; the display list carries it as a `backdrop` quad (`KUI_QUAD_BACKDROP` in C) either way. |
| `bg` | `bg` | `bg` | `Spec.bg` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | Background fill. |
| `bounce` | `bounce` | `bounce` | `Spec.bounce` | number, or a `"$length"` token | How far a spring overshoots its target: 0 glides in with none, 0.5 bounces visibly, and values past 0.9 are held there (a spring at 1 would never settle). It replaces a spring `easing`'s own bounce (`smooth` 0, `snappy` 0.15, `spring` 0.25, `bouncy` 0.5), and on a timed easing makes the transition a spring — so `transition` plus `bounce` is a spring of that length and bounce. It does nothing between `keyframes` stops, which are sampled off the clock (see that row). |
| `buttons` | `buttons` | `buttons` (`KUI_BUTTONS_*` bits; zeroed, all three) | `Spec.buttons` | string | Which non-primary buttons `onButton` claims (backlog F105): `"secondary"`, `"middle"` and `"other"` (every button past those), separated by spaces or commas — `"middle"`, `"secondary middle"`. Unset, all three: a node that wants the middle button and leaves the secondary one to its context menu says `"middle"`. A word that is none of the three is skipped, so a string of none of them claims nothing, and a typo never takes the secondary button from a context menu. Meaningless without `onButton`. |
| `caret` | `caret` | `caret` with `KUI_VALUE_CARET` in `value_set` | `Spec.caret` | number, or a `"$length"` token | On a `line` of a custom editor (a `textInput` / `multilineTextInput` role drawn by the app): the caret's byte offset into that line's text. |
| `caretSolid` | `caret_solid` | `caret_solid` | `Spec.caret_solid` | boolean | On a `line` declaring `caret`: the caret is solid — a block caret in a modal editor's normal mode — so the driver's blink clock is not armed on it and `caretVisible` stays true, while the offset still anchors the IME and reads to assistive technology. Without it a declared `caret` is a caret to blink, and the one thing that asks an idle app for a frame twice a second; an editor whose caret only blinks while typing declares this on every other mode's line. |
| `center` | `center` | `main_align` + `cross_align` = `KUI_CENTER` | `Spec.center` | boolean | Center children on both axes. |
| `checked` | `checked` | `checked` | `Spec.checked` | boolean | The on state of a `checkbox` / `radio` / `switch` role. |
| `clickSound` | `click_sound` | `click_sound` | `Spec.click_sound` | resource handle | A registered sound (addSound) played when the node is clicked; implies hover tracking. |
| `crossAlign` | `cross_align` | `cross_align` | `Spec.cross_align` | `start` \\| `center` \\| `end` \\| `spaceBetween` \\| `spaceAround` \\| `spaceEvenly` \\| `baseline` | Child alignment across the main axis. On a row, `baseline` lines up the first baselines of the children's text, so a label and a larger value read as one line; a child with no text aligns by its bottom edge, a `grow` or percent height fills the line from its top, and a fit-height row grows to hold the aligned children. A column lays `baseline` out as `start` (as CSS does), and the three spreads mean nothing across an axis — each with a warning. |
| `crossGap` | `cross_gap` | `cross_gap` | `Spec.cross_gap` | number, or a `"$length"` token | Space between wrap lines, across the main axis (`gap` stays the space along it). |
| `cursor` | `cursor` | `cursor` (`KUI_CURSOR_*`) | `Spec.cursor` | `default` \\| `text` \\| `pointer` \\| `grab` \\| `grabbing` \\| `notAllowed` \\| `ewResize` \\| `nsResize` \\| `nwseResize` \\| `neswResize` | The pointer shape over this node. Unset, the pointer is `text` over an editor or a `selectable` scope and `default` over everything else — an `onClick`, `focusable` or `onDrag` node included, as a native button is — so a hand (`pointer`) over a control, a `grab` over a handle (and `grabbing` while its drag runs, which the view declares as its drag state changes), a splitter's `ewResize` / `nsResize` and a `disabled` control's `notAllowed` are all declared. The stock `button` declares `pointer` itself. A captured drag keeps the dragged node's shape wherever the pointer goes. |
| `delay` | `delay` | `delay_ms` | `Spec.delay` | number, or a `"$length"` token | Holds the `keyframes` cycle back by this many ms (CSS `animation-delay`); siblings with different delays run out of phase. |
| `description` | `description` | `description` | `Spec.description` | string | The accessible description: the extra sentence a reader says after the name, for what the name cannot say on its own — what a button will do, why a control is disabled, what format a field wants. `tooltip` is the shorthand that also draws the string and hover-tracks the node; this is the description alone, for a hint that is spoken and never drawn. Both write the one slot, so a node declaring both keeps whichever its binding applied last. It reads only on a node that reaches the access tree — a role, a label, a control — since a plain box is elided and takes its description with it. |
| `disabled` | `disabled` | `disabled` | `Spec.disabled` | boolean | Inert: no click, drag or key sink, no hover / pressed / focus background, skipped by Tab, reported disabled to assistive technology; hover tracking stays so a `tooltip` can say why. |
| `dropBg` | `drop_bg` | `drop_bg` | `Spec.drop_bg` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | Background while files dragged in from the OS are over this node (ADR 0031); wins over pressedBg, focusBg and hoverBg, clears when they leave, land or the drag is cancelled. Implies hover tracking, eases with `transition`. |
| `dx` | `dx` | `dx` | `Spec.dx` | number, or a `"$length"` token | Moves this node and everything under it this many logical px across from where layout put it (backlog C105) — negative to the left. The move is made to the places after layout, as a keyframe's position stop is: the subtree is drawn there on whole physical pixels, hit there and read there by assistive technology, while the room it takes is its place's, nothing around it moves, and `onLayout` reports the place. Tweens with `transition` (with `rotate` and `scale`, one slot), and a `when` entry may set it, so a button's face lifts on hover and sinks on press with no view code: `when: [{ hovered: true, dy: -1 }, { pressed: true, dy: 1 }]`. Hit where it is drawn, so a hover that moves the node out from under a resting pointer flickers: move by a pixel or two. Not a float's `dx`, which is inside the `float` table and places the float. |
| `dy` | `dy` | `dy` | `Spec.dy` | number, or a `"$length"` token | Moves this node and everything under it this many logical px down from where layout put it (backlog C105) — negative up. See `dx`, which it pairs with: drawn, hit and read there, its room its place's, eased by `transition`, settable by a `when` entry. |
| `easing` | `easing` | `easing` (`KUI_EASE_*`) | `Spec.easing` | `easeOut` \\| `linear` \\| `easeIn` \\| `easeInOut` \\| `spring` \\| `bouncy` \\| `smooth` \\| `snappy` | Easing for `transition` (default easeOut). The springs — `smooth` (no overshoot), `snappy`, `spring` and `bouncy` (the most), each a `bounce` of its own — integrate with momentum, so a value retargeted mid-flight keeps moving the way it was; `transition` is then about how long one takes to get there. Between `keyframes` stops a spring is drawn as `easeOut` (see that row). |
| `enter` | `enter` | `enter` (`KuiEnter`, with `set` bits) | `Spec.enter` | entrance (`{ dx?, dy?, width?, height?, bg?, radius?, opacity?, rotate?, scale?, scaleX?, scaleY? }`) | Where the node starts the first frame it is seen `{ dx?, dy?, width?, height?, bg?, radius?, opacity?, rotate?, scale?, scaleX?, scaleY? }`: those slots ease in from there over `transition` ms instead of snapping (`dx`/`dy` slide it in from that far away, `opacity: 0` fades the whole subtree in, `scale: 0.8` settles it in). |
| `essentialMotion` | `essential_motion` | `essential_motion` | `Spec.essential_motion` | boolean | The node's `keyframes` cycle is essential motion — a spinner or an under-way bar, whose movement says work is going on — and keeps running when the user asked for reduced motion (backlog C107). Without it, under reduced motion a cycle that runs for ever holds still, the node showing its own props as if it declared no stops, and a finite one (`iterations`) rests where its last iteration ends, as a transition jumps; neither owes a frame. A `when` entry cannot set `keyframes`, so this is how a view honours the setting without reading `env.system.motion`. |
| `exit` | `exit` | `exit` (`KuiEnter`, with `set` bits) | `Spec.exit` | entrance (`{ dx?, dy?, width?, height?, bg?, radius?, opacity?, rotate?, scale?, scaleX?, scaleY? }`) | Where the node ends the frame after the view stops declaring it `{ dx?, dy?, width?, height?, bg?, radius?, opacity?, rotate?, scale?, scaleX?, scaleY? }` — an `enter` read the other way. It plays when the node itself is removed, its parent still declared; a node that goes because an ancestor went — a tab switched away, a panel closed around it — goes at once with it, unless that ancestor has an `exit` of its own, whose picture carries it (backlog DX19; React's `AnimatePresence` rule). With a `transition`, the departing subtree is copied out of the last frame that had it and replayed frozen, in its place (the pass it painted in, just under the node that painted after it — a panel under a HUD leaves under it) and inert (no clicks, no Tab stop, no access row) while those slots ease from where they were, then dropped; without one it vanishes at once as it always did. `width`/`height` resize the departing node's own box only — the subtree inside it is a picture and is not laid out again. The exit read is the one the last frame that had the node declared, unless `exit_with` named another for the frame it went in: a card a button throws left or right is aimed by the handler that removes it, with no frame drawn first to point it. Needs a stable key across frames. `keepRoom: true` (`keep_room`) keeps the departing node's room in the layout until its exit ends and gives it up then, so what follows it moves in after it has gone rather than while it goes — a toast leaving a stack, the others closing up behind it, gliding where they `slide` (backlog C110); an in-flow node's only, a float taking no room. |
| `expanded` | `expanded` | `expanded` (`KUI_EXPANDED_*`) | `Spec.expanded` | `collapsed` \\| `expanded` | A disclosure's state: what a node that shows and hides something (a twisty, an accordion header, a menu button) reads as. Unset, the node does not expand at all — which is why this names its state instead of being a flag. |
| `floatsInOrder` | `floats_in_order` | `floats_in_order` | `Spec.floats_in_order` | boolean | Paint the floats under this node in tree order, the last declared on top, worked out again every frame — the order its in-flow children paint in — instead of the order they opened: a drawing canvas whose items are floats stacks them as its file does, so an item that pans into view or is added takes its place in the order rather than going over the rest, and moving an item in the tree moves it in the stack on the next frame. Every float at any depth under the node takes part, and one nested in another is still over the float it is in. As a group they keep the place the stack gives them among the floats outside the node: a menu opened after them stays over all of them, a new item included. A menu declared under the node is one of them and paints by its place; declare it outside the node to have it open over everything. The hover hint the core floats for a `tooltip` is the exception, over them all. The hit test reads the same order. Not a z-index: the order is the tree's (`docs/adr/0053-floats-under-a-node-paint-in-tree-order.md`). |
| `focusBg` | `focus_bg` | `focus_bg` | `Spec.focus_bg` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | Background while the node holds keyboard-visible focus (moved there by Tab or assistive technology, not a click); replaces the default focus ring. Pressed wins over focus wins over hover; eases with `transition`. |
| `focusRegion` | `focus_region` | `focus_region` | `Spec.focus_region` | boolean | Makes this node's subtree a focus region: a Tab ring of its own that the ring outside never enters and that never leaves — a devtools dock, an inspector beside the app (`docs/adr/0022-focus-regions.md`). Entered on purpose: `focusRegion(name)` (`Ui::focus_region`, `env.focus_region`, `kui_focus_region`) moves focus in — to the focus the region last held, else its `initialFocus`, else its first stop — and `focusRegion(null)` moves it back to the main ring the same way; a press inside the region, or an explicit focus on a node in it, enters it too. Tab then walks that ring alone, wrapping inside it; with nothing focused, Tab enters the ring of the region in effect (`region()`). A region that stops being declared hands focus back to what the main ring last held. Only the ring is scoped: keys still bubble through the boundary to the sink above (a region that wants its own keymap is an `onKey` sink), the pointer and assistive technology see a plain node, and a `modal` in effect is the ring wherever it sits. Nested regions are skipped by the outer ring the way the main ring skips them. |
| `focusRing` | `focus_ring` | `focus_ring` | `Spec.focus_ring` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | The colour of the ring the core draws around a keyboard-visibly focused node — a control, a `focusable` box, an `onKey` sink — for this node and everything under it that declares none (backlog C93): the nearest declaration on the focused node or above it wins, else the theme's `focusRing`. A colour with no alpha draws no ring, turning it off without touching the background as `focusBg` would (in C, whose 0 is unset, any colour with no alpha but 0: `0xffffff00`). What an add-on that paints in its own palette sets once at the root of what it draws, `focusRing="$kitFocus"`. |
| `focusable` | `focusable` | `focusable` | `Spec.focusable` | boolean | Reachable by Tab (and focused by a click) without a click payload or a control role — a row that opens on Enter. Editors, key sinks, `onClick` boxes and the control roles are focusable already. |
| `gap` | `gap` | `gap` | `Spec.gap` | number, or a `"$length"` token | Space between children along the main axis. |
| `gradient` | `gradient` | `gradient` (`const KuiGradient *`) | `Spec.gradient` | gradient (`{ to? \\| angle? \\| radial?, at?, stops: [color \\| [color, at], …] }`) | A gradient painted over the node's `bg` and under its border and its children (`docs/adr/0042-a-gradient-is-an-image-the-core-paints.md`): `{ to: 'bottom', stops: [...] }` towards a side or a corner (`right`, `bottom left`, …; the default is `bottom`), `{ angle: 0.125, stops }` in turns clockwise from east, or `{ radial: true, at: [0.5, 0], stops }` out from a centre (fractions of the box, the middle by default) to its farthest corner. A stop is a colour — a `$token` too — or `[colour, position]` with the position 0 to 1; stops without one are spaced evenly between those with. Two stops at one position are a hard edge. The gradient is defined on the box's unit square and stretched to it, so a side or a corner is CSS's and any other `angle` runs corner to corner at an eighth of a turn whatever the box's aspect, where CSS's pixel-measured `45deg` does not. Stops mix in straight sRGB with the alpha premultiplied, as CSS's do. What it costs is one image quad: the core rasterizes each distinct gradient once into the glyph atlas — a 256-texel strip along an axis, a 128-texel square otherwise, within half an 8-bit level of the gradient computed per pixel for a linear one and 1.2 for a radial — keyed by the gradient and not the box, so a box that resizes and a thousand boxes that share one rasterize nothing, and a host that draws an image draws it; a gradient box costs about 55 ns over a flat one, so ten thousand of them are half a millisecond. A hard edge is as soft as the raster stretched to the box (a 256th of its length along a strip); stripes are boxes. It does not tween — `transition` eases the `bg` under it and `opacity` fades it — and `hoverBg` and the other state backgrounds replace `bg`, not the gradient; one that changes every frame is a raster a frame, and a shimmer is a `fragment`'s. Ignored on a `line`, a `polygon` and a `path`. Fewer than two stops are an error in JSX and Lua, as a malformed `keyframes` is, and draw nothing in Rust and C. A stop whose `$token` misses is not an error: it is raised as `unknown-token` and left out, as a miss leaves any slot unset, and the rest are spaced as if it had not been declared — so a gradient left with fewer than two stops, a two-stop one with a typo, draws nothing over its `bg` (backlog RG118). |
| `height` | `height` | `height` (KuiSizing) | `Spec.height` | sizing (`number` \\| `"fit"` \\| `"grow"` \\| `"N%"` \\| a size expression \\| `"$length"`) | Vertical size: px \| "fit" \| "grow" \| "N%" \| a size expression (see `width`). |
| `hidden` | `hidden` | `hidden` | `Spec.hidden` | boolean | Not laid out and not drawn (ADR 0069): the node and everything in it take no room in its parent — no gap either — paint nothing, take no input and are out of the access tree and the Tab ring, while their keys, focus history and retained state (scroll offsets, editor text) are kept as any declared node's are. What a `when` entry sets to drop a node at a setting or a window size; an entry over the node's own size names the children it hides instead (`hidden: ["key"]`). |
| `hostHit` | `host_hit` | `host_hit` | `Spec.host_hit` | `auto` \\| `block` \\| `pass` | What a host that draws the UI over a world of its own — a game, a map, a 3D view — counts this box as when it asks whether the pointer is over the UI (`Core::hit` / `pointer_wants`, `kui_hit` / `kui_pointer_wants`, `Ctx.hit` / `pointerWants`; backlog F233): `auto` (the default) blocks the world where kui takes the pointer (a click, a hover, a drag, an editor) or where the box paints — a background, a border, an image — and lets it through over bare text and a box that paints nothing; `block` blocks wherever the box is, painted or not, a transparent catcher over a minimap; `pass` lets the pointer through a painted box to the world, a damage flash or a vignette over the whole window. A node kui takes the pointer on blocks whatever this says, so a click is never both kui's and the world's. kui's own hit testing is unchanged: only the host's question reads it. |
| `hoverBg` | `hover_bg` | `hover_bg` | `Spec.hover_bg` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | Background while the pointer is over the node or anything inside it, a clickable child included (or while any node in its hoverGroup is); implies hover tracking, eases with `transition`. |
| `hoverGroup` | `hover_group` | `hover_group` (KuiStr) | `Spec.hover_group` | string | Nodes sharing a group name show hoverBg/pressedBg together (a split button, a multi-piece shape). |
| `hoverSound` | `hover_sound` | `hover_sound` | `Spec.hover_sound` | resource handle | A registered sound (addSound) played when the pointer enters the node; implies hover tracking. |
| `hoverable` | `hoverable` | `hoverable` | `Spec.hoverable` | boolean | Hover-track without a click payload (for isHovered-driven styling). |
| `initialFocus` | `initial_focus` | `initial_focus` | `Spec.initial_focus` | boolean | Where focus lands when the enclosing `modal` scope is entered: the first node in the modal's Tab ring declaring it, so a destructive confirm opens on its Cancel rather than on whichever control is declared first. Read on entry only — a Tab press afterwards stands, and the scope re-entered (a nested confirm closing) leaves focus where it was. Declared on nothing, or only on nodes the ring skips (disabled, `role="none"`, not focusable), entry stays the ring's first node. |
| `iterations` | `iterations` | `iterations` (0 is for ever) | `Spec.iterations` | number, or a `"$length"` token | How many times the `keyframes` cycle runs (CSS `animation-iteration-count`, backlog F133); left out, for ever. A finite cycle plays from the first frame the node is declared with it — a node that leaves and comes back plays again — holds its first stop through its `delay`, and rests where its last iteration ended (CSS's fill `both`): `1` plays a burst or a shake once, `2` with `repeat: "alternate"` goes out and back and ends where it began, `0.5` stops halfway. Once it is over the node owes no frame, so `animating()` and `owed()` go quiet as a settled transition's do; `delay` plus `iterations: 1` staggers one-shots. A count that is not a positive number is for ever. C: 0 is for ever. |
| `keepFocus` | `keep_focus` | `keep_focus` | `Spec.keep_focus` | boolean | A press on this node, or anywhere inside it, leaves keyboard focus where it was: a toolbar button, a tab or a divider that acts without taking the keyboard from the editor or key sink that had it. Without it a press on an `onClick` node focuses the node, and the app's keys stop reaching the sink until it takes focus back. The press also leaves a text or cell selection and the Tab ring where they were, so a Copy button copies what was selected. An `<edit>` inside still takes its caret and focus, as the keyboard's own owner. The click, drag and hover are unchanged, and Tab and assistive technology still reach the node. |
| `keyUp` | `key_up` | `key_up` | `Spec.key_up` | boolean | With `onKey`: releases arrive too, as the same payload with phase:"up" (`text` null, `repeat` false) — for a held-key interaction (WASD, press-and-hold, a key that arms a mode while it is down). A key only comes up where it went down: a release whose press the sink never got is dropped, and focus leaving while a key is held delivers the `up` first, so nothing is left stuck down. Without it a sink hears presses only, which is what a keymap wants — one that heard both halves would run every binding twice. |
| `keyframes` | `keyframes` | `keyframes` + `keyframes_len` (`KuiKeyframe[]`) | `Spec.keyframes` | keyframe list (`[{ at?, dx?, dy?, width?, height?, bg?, radius?, opacity?, rotate?, scale?, scaleX?, scaleY? }, …]`) | CSS-style stops `[{ at?, dx?, dy?, width?, height?, bg?, radius?, opacity?, rotate?, scale?, scaleX?, scaleY? }, …]`: the slots they name cycle through them over `transition` ms, for ever unless `iterations` says how many times, without the view redrawing; `at` is 0..1 and spreads evenly when omitted. `dx` / `dy` are logical px from where layout put the node (backlog F132), as an entrance's are: the node and its subtree are drawn and hit that far away at the stop, a lane a stop leaves out is 0, and the offset adds to a `slide`'s, so `[{ dy: 0 }, { dy: -6 }]` with `repeat: 'alternate'` bobs a box and a sparkle drifts up its stops. Paint, hit and access only: layout and the room the node takes are its own place's, and an `onLayout` node reports its layout rect, not the cycle, which would post an event every frame it runs. The `easing` applies to each step between two stops, as CSS applies its timing function per keyframe; a spring easing there is drawn as `easeOut` and `bounce` does nothing, since a cycle is sampled off the clock and a spring has to be integrated (backlog F141) — an overshoot in a cycle is a stop past the target, `[{ scale: 1 }, { scale: 1.15, at: 0.6 }, { scale: 1 }]`. A running cycle asks for frames while the frame draws its node: one the frame culled — scrolled out of its scroller, clipped away, off the window — owes none, and is sampled again at the clock on the frame that brings it back (backlog C137); a cycle that moves its node is measured over the reach of its stops, and one of a `width` or a `height` always runs, since it moves what is laid out beside it. |
| `label` | `label` | `label` (KuiStr) | `Spec.label` | string | The accessible name. Without one a button, link, tab or heading is named by the text inside it; an image, an icon-only button and a `modal` dialog have none, and the core warns (`image-without-label`, `control-without-name`, `modal-without-name`). Not the key label a `key` prop or `with_keyed` declares, which `key_of` looks up and a reader never hears; `key_named` looks a node up by this name. |
| `live` | `live` | `live` (`KUI_LIVE_*`) | `Spec.live` | `off` \\| `polite` \\| `assertive` | Marks this node a live region: when the text inside it changes, a screen reader reads the change without being asked — `polite` at the next pause, `assertive` interrupting. Put it on the smallest node that holds the message, since everything inside a live node is live. For a one-off with no node behind it ("Saved") the binding's `announce` verb is the other half. |
| `mainAlign` | `main_align` | `main_align` | `Spec.main_align` | `start` \\| `center` \\| `end` \\| `spaceBetween` \\| `spaceAround` \\| `spaceEvenly` \\| `baseline` | Child alignment along the main axis. `start`, `center` and `end` put the children together; `spaceBetween` deals the free space out between them (none at the ends), `spaceAround` gives each child an equal share split to its two sides, and `spaceEvenly` makes every gap and both ends equal — CSS's `justify-content`. The spread is added to `gap`, and there is none when nothing is free: a `grow` child takes it all, and an overflowing run keeps its gaps. `baseline` means nothing here and lays out as `start`, with a warning. |
| `maxHeight` | `max_height` | `max_height` | `Spec.max_height` | maximum (`number` \\| a size expression \\| `"$length"`) | Upper height clamp: logical px or a size expression (see `width`). |
| `maxWidth` | `max_width` | `max_width` | `Spec.max_width` | maximum (`number` \\| a size expression \\| `"$length"`) | Upper width clamp: logical px or a size expression (see `width`); grow+maxWidth is the responsive-width pattern. |
| `minColumn` | `min_column` | `min_column` | `Spec.min_column` | number, or a `"$length"` token | On a row: wraps it into equal columns, as many as fit at this width or more — `max(1, floor((w + gap) / (n + gap)))` — every child as wide as a column, the last line's children too, which do not stretch (ADR 0069, decision 17). CSS's `repeat(auto-fill, minmax(n, 1fr))`: a gallery's cards, a settings grid. The lines are `crossGap` apart. An own-size `when` entry may set it, and on a column it does nothing. |
| `minHeight` | `min_height` | `min_height` | `Spec.min_height` | minimum (`number` \\| `"fit"` \\| a size expression \\| `"$length"`) | Lower height clamp: logical px, a size expression, or "fit" for the node's own fit height. Undeclared, it is the node's content where its column overflows — CSS's `min-height: auto`, none for a node that scrolls or clips — so a row keeps the height of its text; `0` asks for the squeeze back (see `minWidth`). |
| `minWidth` | `min_width` | `min_width` | `Spec.min_width` | minimum (`number` \\| `"fit"` \\| a size expression \\| `"$length"`) | Lower width clamp: logical px, a size expression (see `width`; a percentage clamp is none until the parent's width is known, as in CSS), or "fit" for the node's own fit width. "fit" under `width="grow"` is a content floor — CSS's `flex: 1 0 auto` — which is what an i3-style tab bar is: tabs that split the bar evenly while they fit and sit at their label's width, scrolling, once they do not. Opt-in, because a fit width is the unwrapped one: a paragraph in a grow column would stop wrapping under it. Left out, a child giving in an overflowing row that holds a percentage or a size expression stops at its content, CSS's `min-width: auto`; `0` lets it go below, CSS's `min-width: 0` (backlog RG92). A fit node across a column is no wider than the column's box — CSS's `fit-content` — down to this floor, 0 left out, unless the column scrolls x, so a text one wrapper deep in a capped card wraps there; "fit" keeps its content's width and runs past (backlog F116). |
| `mixed` | `mixed` | `mixed` | `Spec.mixed` | boolean | A `checkbox` that is neither on nor off — the select-all box over a list some of whose rows are selected (ADR 0034). Read as mixed by assistive technology whatever `checked` says, and drawn as a dash by the stock `<checkbox>`. Meaningful on the checkbox role alone. |
| `modal` | `modal` | `modal` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.modal` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Modal surface: the Tab ring becomes this node's subtree, everything outside it is inert to the pointer, the wheel and assistive technology, and Escape or a press outside arrives on it as this message with `dismiss: {reason: "escape" \| "outside"}` in it (ADR 0047) — the app stops declaring the node. A modal whose role is `menu` (a dropdown, a popover of rows) is dismissed with `reason: "accelerator"` too, when a key under the primary modifier (⌘C and the like) or a row of the platform's menu bar is chosen while it is open, and the press goes to the window, focus back where the menu took it from (backlog C109). The last one declared in tree order is the one in effect (a confirm inside a dialog); a modal that must cover the app is a float. The access tree is not pruned to the modal: it keeps every node of the frame and marks the one in effect `modal` (`docs/adr/0003-modal-surfaces.md`, decision 7), which is what assistive technology acts on. |
| `modifierKeys` | `modifier_keys` | `modifier_keys` | `Spec.modifier_keys` | boolean | With `onKey`: the modifier and lock keys arrive as keys of their own (backlog F108) — `code` "shift", "ctrl", "alt", "super", "capslock", "numlock", "scrolllock", which side in `location` ("left" / "right"), releases too with `keyUp`. Without it a modifier is only ever held — the next key's `shift`, `ctrl`, … and the `modifiers` event — so a keymap mid-sequence never reads a Shift as a key between two others. For a terminal speaking kitty's keyboard protocol, or a game that binds a lone Shift. |
| `onBoundary` | `on_boundary` | `on_boundary` | `Spec.on_boundary` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | An editing key that met the edge of an editor's text and did nothing, as this message with `boundary: {key, edge, word, doc, ctrl}` in it (ADR 0047, backlog F145): ↑ on the first line, ← or Backspace at the start (`edge: "start"`), ↓ on the last line, → or Delete at the end (`"end"`) — from a caret with no selection and without Shift. What a block editor joins blocks and moves between fields by. A field has one line, so its ↑ and ↓ always report. `word` and `doc` are the editing modifiers the key carried. |
| `onButton` | `on_button` | `on_button` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.on_button` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Button handler (backlog F105): a press of a non-primary button — middle, secondary, or one past those — arrives on the node as this message with `button: {phase: "press", button, x, y, clicks}` in it (ADR 0047), and the button is then captured by it: every pointer move while it is held arrives as phase:"move" and its release as phase:"release", on this node wherever the pointer is. `button` is `"secondary"`, `"middle"` or a further button's number (3 and up); `x`/`y` are logical viewport coordinates, and on a `cells` grid each event carries `cell: {row, col}` as a click does. Several buttons can be held at once, each its own capture, and a primary drag is untouched. `buttons` says which buttons it claims — all of them unless it narrows them. Asked of the topmost node under the pointer, and when that node claims no such button the press reaches the nearest enclosing node that does, the way a context menu's does: a disabled node's own is skipped and the walk stops at the modal boundary. A claimed secondary press is this event *instead of* a `contextmenu` event and the stock menu (a nearer `onContextMenu` still wins, being the nested declaration). Like every non-primary press it moves no focus, places no caret and touches no selection or scrollbar. For a terminal's middle-click paste, and the mouse reports a program in it asked for. |
| `onCancel` | `on_cancel` | `on_cancel` | `Spec.on_cancel` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Escape letting go of a focused editor, as this message — a map as declared, any other message under `tag`, none as `{}` (ADR 0047): the keyboard leaves it, as it does for a click elsewhere, and this says it was Escape — a draft abandoned, where `onSubmit` is one confirmed and a plain blur is neither. A field that commits on blur cancels here instead. |
| `onChange` | `on_change` | `on_change` | `Spec.on_change` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Changes, as this message with `change` in it (ADR 0047). On a `slider` role (ADR 0034) the core turns a press on the node into the value under the pointer, a drag into the value under it, the arrows and assistive technology's increment / decrement into one `valueStep`, PageUp / PageDown into ten, Home / End into the range's ends — clamped to `valueMin`..`valueMax` (0..100 unset) and snapped to the step — and proposes it as `change: {value, phase}`: `phase` is `"move"` while the pointer holds the slider and `"end"` when it lets go or a key moved it. The value is proposed and never applied; the slider moves when the view declares it as `valueNow`. A key that lands where the slider already is proposes nothing. The pointer reads the node's content box along its main axis, so a `dir="column"` slider runs bottom to top. Without it a slider does not move and a key or a reader's request raises `slider-without-handler`. On an editor — an `edit`, or a node with an editor role that draws its own text — every change to the text arrives as `change: {text}`, the whole text after it: typing, a paste, a composition's commit, assistive technology setting the value. Ignored on any other role. |
| `onClick` | `on_click` | `on_click` argument of `kui_open` / `kui_open_with` | `Spec.on_click` | message (any plain data) | Message emitted when clicked (data, not a callback). |
| `onContextMenu` | `on_context_menu` | `on_context_menu` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.on_context_menu` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Context-menu handler: a secondary-button (right) press arrives on the node as this message with `contextmenu: {x, y}` in it (ADR 0047), at the logical viewport point to open the menu at. The press moves no focus, places no caret and produces no click, so right-clicking a selection keeps it. Asked of the topmost node under the pointer, and when that node offers no menu the press reaches the nearest enclosing node that does — a container declaring a menu for everything inside it is the common case — the way an unclaimed key reaches the enclosing sink (`docs/adr/0011`): the event carries the *owner's* key and message, a nested declaration wins over its ancestor's, a disabled node's own is skipped, and the walk stops at the modal boundary. |
| `onDrag` | `on_drag` | `on_drag` argument of `kui_open_draggable` / `kui_open_with` | `Spec.on_drag` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Drag handler: the drag arrives as this message with `drag: {phase, x, y, dx, dy, parent}` in it (ADR 0047), `dx`/`dy` measured from the press point in every phase. On a `cells` grid the events also carry `cell: {row, col}`; inside an `onKey` sink that draws `role="line"` rows they carry `line`, `byte` and `clicks` — see the events table. A press on a child that does nothing with a press itself drags the nearest enclosing `onDrag` node, stopping at a clickable, a key sink, window chrome, a slider, the modal boundary and the selection scope the press is in (backlog F176). |
| `onDrop` | `on_drop` | `on_drop` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.on_drop` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Drop-zone handler (`docs/adr/0031-a-drop-zone-is-a-row-and-the-files-are-an-event.md`): files dragged in from the OS over this node arrive as this message with `drop: {phase: "enter" \| "move" \| "leave" \| "drop", paths, x, y}` in it (ADR 0047) — `paths` the OS paths as strings, `x`/`y` the pointer in logical viewport coordinates (absent on `leave`). The zone under the files is the topmost zone by paint order: a node inside a zone is the zone's (a button in it, a field in it), and a node that is no zone and has none enclosing it is looked past, so an overlay shown on `enter` cannot make the zone lose the files. No `leave` follows a `drop`; a drop off every zone is refused by the driver. Implies hover tracking. No access row — a screen-reader user's way in is a button beside the zone. On Windows and Linux the position is the OS cursor at enter and release only, so `move` never fires there. |
| `onFocus` | `on_focus` | `on_focus` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.on_focus` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Keyboard focus entering or leaving this node's subtree — the node itself, or anything focused inside it — arrives as this message with `focus: {phase: "in" \| "out", by}` in it (backlog DX18, ADR 0047). `by` is what moved it: `pointer` (a press), `keyboard` (Tab, a key a control answered), `assistive` (a screen reader's request) or `program` (the view or the app — `keyFocus`, `setFocus`, a modal's entry). Reported once the move settles, after the input that made it or at the end of the frame that declared it, so an app hears a pane taking the keyboard instead of diffing the focused key every frame. Leaving is reported innermost first, entering outermost first. It makes nothing focusable or interactive. |
| `onForceClick` | `on_force_click` | `on_force_click` | `Spec.on_force_click` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Force-click handler: a press that deepens past the second stage of a Force Touch trackpad arrives on the node as this message with `forceclick: {x, y}` in it (ADR 0047), at the logical viewport point it happened at (`docs/adr/0017-selection-as-a-scope.md`). Routed as a secondary press is — no focus moved, no caret placed, no click — but asked of the topmost node only, with no walk to an enclosing declaration — and the ordinary click the press is still producing arrives afterwards, as it does on macOS. Text needs none of this: a force click over an `edit` or a `selectable` scope selects the word under it and asks the host for its Look Up panel. macOS-only in practice, and there the user can switch the gesture off, so nothing may declare itself the only way to reach something. |
| `onHover` | `on_hover` | `on_hover` argument of `kui_open_with` | `Spec.on_hover` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Hover handler: the pointer entering or leaving arrives as this message with `hover: {phase: "enter" \| "leave", by}` in it (ADR 0047). |
| `onItemKey` | `on_item_key` | `on_item_key` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.on_item_key` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Item-key handler, on a composite container — a `list`, a `table`, a `menu`, a `radioGroup` or a `tabList` (backlog C120): a key its focused item does not claim arrives as this message with `itemkey: {code, …, item, index, column?}` in it — Delete or Backspace on a checklist's row, Enter on an item with nothing to press, a function key. Not the arrows, Home / End, the pages, Space or the type-ahead letters the composite moves with, not Tab or Escape, and not a chord with Ctrl, Alt or ⌘, which still bubbles to the key sink above — but select all (⌘A on a Mac, Ctrl+A elsewhere), which is the rows' in a list or a table. `item` is the focused item's key, `index` its data `index` (else its place among the items, from 0), `column` a table cell's column; the press's fields are a `key` event's. The container stays one Tab stop and its items keep their arrows, where an `onKey` on either would take them; a control focused inside an item reports the item. |
| `onKey` | `on_key` | `on_key` argument of `kui_open_with` | `Spec.on_key` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Key sink: with key focus held, presses arrive as this message with `key: {phase: "down", code, …}` in it, and a composition, a commit and a reader's selection as `preedit`, `text` and `select` the same way (ADR 0047). Releases only with `keyUp` beside it. A key a focused node inside it leaves comes up to it (ADR 0011); a sink around Tab stops is a keymap over them and no Tab stop of its own, one around nothing focusable is one. |
| `onLayout` | `on_layout` | `on_layout` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.on_layout` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Layout handler: the node's laid-out rect arrives as this message with `layout: {x, y, w, h, parent, scale}` in it (ADR 0047) on its first frame and whenever it changes (needs a stable key). |
| `onMenu` | `on_menu` | `on_menu` | `Spec.on_menu` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | A choice from a menu opened for this node — a `select`'s, or one `openMenu` named it the target of — as this message with `menu: {role, item}` in it (ADR 0047): `item` is the row's `id`, else its label. The stock right-click menu, whose roles the core performs itself, sends nothing. |
| `onQuery` | `on_query` | `on_query` | `Spec.on_query` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Query handler (ADR 0069): when the set of this node's `when` entries over its own size and the window's that match changes — and after the frame that first lays it out — this message arrives with `query: {matched, width, height}` in it, `matched` the 0-based indices of every matching entry. On a lazy branch's node, its decision: `matched` is `[0]` while `render` is built. State and environment changes do not raise it. Nothing needs it to lay out; it is for a view that keeps the fact in its model. |
| `onRange` | `on_range` | `on_range` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.on_range` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Range handler (ADR 0065): on a node whose children carry data indices — `index`, a virtual list's rows — the least and greatest index among its children inside its box arrive as this message with `range: {first, last}` in it, after the frame that first lays it out and whenever either changes; what a table pages an unbounded source by. Needs a stable key. |
| `onScroll` | `on_scroll` | `on_scroll` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.on_scroll` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Scroll handler: the wheel over this node arrives on it as this message with `scroll: {x, y, dx, dy, lines, zoom?}` in it (ADR 0047) instead of scrolling anything — `dx`/`dy` the delta in logical px as the driver reported it (positive `dy` is the wheel rolling up, toward earlier content), `x`/`y` the pointer, and `lines` on a `cells` grid the whole lines the delta covers (positive = later history, the sign `originLine` grows in; the fraction is carried to the next notch so a trackpad's small steps add up) and null on any other node. The node takes the wheel on the axes `scrollAxes` names (both unless it narrows them): a gesture that starts over it is its own whether or not it has anywhere to go — except on an axis the node also scrolls (`scrollX`/`scrollY`, its offset the app's to set), where it is answered by its room as a container is, so at its edge a gesture that way passes to the scroller around it (backlog F118) — and stays its own until it ends, wherever the pointer goes (backlog F107); it reaches no scroll container above it, and a scroller inside it still takes the axes it scrolls while it can move that way, passing this node the rest — the other axis, and a gesture that begins with that scroller at its limit (`overscroll: "contain"` on the scroller keeps it there). The core moves nothing — a grid re-declares `originLine`, a canvas zooms. A drag-select held past a `cells` grid's top or bottom edge arrives here too, once a frame with the lines that frame scrolled by (`docs/adr/0029-a-selection-follows-the-pointer-past-the-edge.md`). A trackpad's pinch over the node arrives the same way, with `zoom` in the data — the magnification since the last event, positive zooming in — and `dx`/`dy` 0 and `lines` null (backlog F256): the innermost `onScroll` node around the pointer when the pinch begins hears the whole of it, whatever its `scrollAxes`, unless it names `scrollMods`; no scroll container takes a pinch, and one begun over no `onScroll` node is nobody's. macOS only, where the trackpad reports one. |
| `onSelectionRange` | `on_selection_range` | `on_selection_range` | `Spec.on_selection_range` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | On a `selectable` scope: a copy reached rows a virtual list has not built, as this message with `selectionrange` in it (ADR 0047) — what a list answers by building them. |
| `onSubmit` | `on_submit` | `on_submit` | `Spec.on_submit` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Enter in a single-line editor, as this message — a map as declared, any other message under `tag`, none as `{}` (ADR 0047). |
| `onTypeahead` | `on_typeahead` | `on_typeahead` (a borrowed `KuiValue*`, cloned while the node opens) | `Spec.on_typeahead` | handler (the message its events arrive as, each event's data in the field named for it; `null` for the field alone) | Type-ahead handler, on a `list` or `table` composite (ADR 0070): a search its built rows did not answer arrives as this message with `typeahead: {text}` in it, the whole search so far. A windowed list's unbuilt rows have no names the core can see; the app searches its data and answers with `answerTypeahead(key, index)`, and the core reaches for that row as a step does. |
| `opacity` | `opacity` | `opacity` with `opacity_set` | `Spec.opacity` | number, or a `"$length"` token | Group opacity 0..1 (default 1): fades this node and its whole subtree, drawn as one picture and faded once in a window (ADR 0056), so a label on its own fill and overlapping pieces fade as one; a renderer that draws the quads itself without groups fades each quad, and overlapping pieces show their seams. Layout, hit-testing and the access tree are untouched; eases with `transition`, and `enter: { opacity: 0 }` fades a panel in. A node's `tooltip` fades with the node's ancestors and not with the node, so a dimmed box keeps a hint that can be read (backlog F178). |
| `opensOnPress` | `opens_on_press` | `opens_on_press` | `Spec.opens_on_press` | boolean | The node's `onClick` arrives on the primary press rather than the release, and the press carries on into what that click opens (backlog C108) — a native pop-up button's press, drag and release. Released over a `menuItem` the frames since have drawn (the menu the click put up, its rows `role: "menuItem"`), the item is clicked, as a click on it would; released on the node itself, or before the pointer moved past the click slop, nothing more happens and the menu stays open for a second click; released anywhere else after moving, the `modal` the click opened is dismissed with `reason: "outside"`, as a press outside it would be. The release over the node is never a second click. A press on the node while its menu is open is outside the modal and closes it, as a pop-up button's does. The keyboard is unchanged: Enter and Space click it as before. The stock `select` opens this way. |
| `overSiblings` | `over_siblings` | `over_siblings` | `Spec.over_siblings` | boolean | Paint this node and its subtree after its siblings, over any it overlaps: a tab that glides past its neighbour under `slide` passes over it whichever way it moved, so the selected tab declared `overSiblings` stays on top without the view tracking when it moves. Siblings otherwise paint in tree order, a later place over an earlier. Only the sibling order changes: the parent still paints under it, what follows the parent over it, it keeps the parent's clip, and a float still opens above it. The hit test reads the same order, so where it overlaps a sibling it takes the press. Two siblings that both declare it paint in tree order between themselves. Not a z-index: there is no number to outbid (`docs/adr/0046-a-node-over-its-siblings-paints-after-them.md`). |
| `overscroll` | `overscroll` | `overscroll` (`KUI_OVERSCROLL_*`; zeroed, auto) | `Spec.overscroll` | `auto` \\| `contain` | What a scroll gesture that starts over this scroller does when it is already at its limit that way (backlog F107, CSS's `overscroll-behavior`): `auto` (the default) passes the gesture on to the scroller around it, `contain` keeps it here, moving nothing until it turns back. A gesture picks its target once, when it starts — the innermost scroller under the pointer that can still move the way it goes — and keeps it until it ends, wherever the pointer or the content has gone; one that reaches a limit midway stops there, whatever this says. Only on the axes the node scrolls: a `scrollY` list that contains still passes a sideways swipe to the strip around it. For a panel or a popup's list whose scrolling must never move what is behind it. |
| `pivotX` | `pivot_x` | `pivot_x` with `pivot_set` | `Spec.pivot_x` | number, or a `"$length"` token | Where across the box `rotate`, `scale`, `scaleX` and `scaleY` are about, as a fraction of its width: 0 the left edge, 0.5 (the default) the middle, 1 the right edge; outside 0..1 is a point past the box. C: `pivot_x` with `pivot_set`. |
| `pivotY` | `pivot_y` | `pivot_y` with `pivot_set` | `Spec.pivot_y` | number, or a `"$length"` token | Where down the box `rotate`, `scale`, `scaleX` and `scaleY` are about, as a fraction of its height: 0 the top, 0.5 (the default) the middle, 1 the bottom. C: `pivot_y` with `pivot_set`. |
| `pixelSnap` | `pixel_snap` | `pixel_snap` | `Spec.pixel_snap` | boolean | Paint this node's background, border, shadow and fragment with each edge on a whole physical pixel: `x` and `x + width` rounded on their own, from where layout put them, as a text's span backgrounds are. Off by default, and a box is drawn where layout put it, so a 1 px `gap` between boxes is there at any scale. On, boxes that share an edge in layout meet on one pixel line, where a join inside a pixel was drawn by halves and left a seam — rows of a band stacked at a pitch that is not whole pixels, or a box that continues a text's selection. Layout, hit-testing, the clip and the children are untouched. A snapped box can draw up to half a pixel from its layout edge and its size can differ by a pixel, so a snapped hairline is 1 or 2 px thick by where it sits. |
| `pressedBg` | `pressed_bg` | `pressed_bg` | `Spec.pressed_bg` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | Background while pressed (or while its hoverGroup is); implies hover tracking. |
| `radius` | `radius` | `radius` | `Spec.radius` | number, or a `"$length"` token | Corner radius for all four corners (logical px); the per-corner props override it when listed after it. On a node that also clips or scrolls it rounds the clip as well, so children stay inside the corners. |
| `radiusBL` | `radius_bl` | `radius_bl` with `per_corner` | `Spec.radius_bl` | number, or a `"$length"` token | Bottom-left corner radius (logical px). |
| `radiusBR` | `radius_br` | `radius_br` with `per_corner` | `Spec.radius_br` | number, or a `"$length"` token | Bottom-right corner radius (logical px). |
| `radiusTL` | `radius_tl` | `radius_tl` with `per_corner` | `Spec.radius_tl` | number, or a `"$length"` token | Top-left corner radius (logical px). |
| `radiusTR` | `radius_tr` | `radius_tr` with `per_corner` | `Spec.radius_tr` | number, or a `"$length"` token | Top-right corner radius (logical px). |
| `repeat` | `repeat` | `repeat` (`KUI_REPEAT_*`) | `Spec.repeat` | `normal` \\| `reverse` \\| `alternate` \\| `alternateReverse` | How `keyframes` cycle (CSS `animation-direction`, default normal). Lua: `direction`, since `repeat` is a keyword. |
| `revealOnHover` | `reveal_on_hover` | `reveal_on_hover` | `Spec.reveal_on_hover` | boolean | Draw this node only while its anchor — the nearest ancestor that tracks the pointer: an `onClick` row, a `hoverBg` card, a `hoverable` group header — is hovered (the pointer over it or anything inside it), holds a press begun inside it, or holds keyboard-visible focus inside it; and while focus of any kind is inside the node itself (ADR 0051). A row's secondary actions, shown for the row under the pointer with no `onHover` and no redraw of the view: the core decides it each frame as it decides `hoverBg`. Hidden is `opacity` 0, eased by a `transition`: the node keeps its room and its hit regions, and stays in the access tree and the Tab ring, so a control in it is there for the pointer that reaches it, the keyboard that tabs to it and a screen reader, and shows for each. With no anchor above it, it is always drawn and `reveal-without-anchor` says so. |
| `role` | `role` | `role` (`KUI_ROLE_*`) | `Spec.role` | `none` \\| `button` \\| `checkbox` \\| `radio` \\| `switch` \\| `slider` \\| `tab` \\| `tabList` \\| `link` \\| `heading` \\| `list` \\| `listItem` \\| `image` \\| `dialog` \\| `group` \\| `textInput` \\| `multilineTextInput` \\| `line` \\| `radioGroup` \\| `menu` \\| `menuItem` \\| `terminal` \\| `table` \\| `row` \\| `cell` \\| `columnHeader` \\| `rowHeader` \\| `progress` \\| `meter` | What the node is to assistive technology. Unset, the core derives one (an `onClick` node is a button, an editor a text input, a scrolling box a scroll view, a plain box nothing); `none` hides the node and its subtree from the access tree — the decorative door, for what a reader need not hear: an icon beside the text that says the same, or a caption under the button it repeats. A text takes no `role` (it has no box), so `none` goes on the box around it; `ambiguous-name` points at it when a caption and its control share a name (backlog F140). Where the caption is all a control says, a `label` on the control that says what it does is the better answer. A `radio` belongs inside a `radioGroup` and a `tab` inside a `tabList`, labelled with what the choice is: the pair is a composite (`docs/adr/0007-composite-keyboard-patterns.md`) — one Tab stop for the set, the arrows, Home and End moving the choice inside it (each step is the item's click, so the choice follows focus), and a screen reader reading "2 of 3". A `radio` or `tab` with no container above it is a Tab stop of its own that no arrow moves, and the core warns (`item-outside-container`). `menu` holds `menuItem`s and `list` holds `listItem`s the same way. `progress` and `meter` are the read-only bars (backlog F267): their position is the value rows (`valueNow`, `valueMin`, `valueMax`, `valueText`), read and announced as a slider's are, and they take no focus; a `meter` is a level (a battery, a disk), a `progress` how far a task has got, and a `progress` with no `valueNow` is busy. The stock `progress` element draws one. |
| `rotate` | `rotate` | `rotate` | `Spec.rotate` | number, or a `"$length"` token | Turns this node and everything under it, in turns clockwise (0.25 is a quarter turn right), about its pivot — the centre unless `pivotX` / `pivotY` say — after layout (`docs/adr/0043-a-node-turns-about-its-pivot.md`). Paint-only: the node takes the room its upright self takes, nothing around it moves, `onLayout` reports the layout rect. Everything the subtree draws turns with it — backgrounds, borders, shadows, text, images, strokes, fragments — and so does what it clips: a child cut by a turned card's rounded corners stays inside them. Hit where drawn: a tilted card is grabbed on its tilted edge and a press in its box past its edge falls through; drag payloads stay in viewport px. The access rect is the bounding box. Nests by composition. Tweens with `transition` as one slot with `scale`, and an entrance, an exit or a keyframe stop may name it (`enter: { rotate: -0.02 }`, `keyframes: [{ rotate: 0 }, { rotate: 1 }]` spins a box). A float anchored to the parent turns with it; a viewport float does not. On a `path` this is the path's own turn (ADR 0041), which does not tween — wrap it in a box for one that does. Text under a turn leaves the pixel grid, as a turned mask does. `backdropBlur` under a turn blurs the upright box. |
| `ruleWidth` | `rule_width` | `rule_w` | `Spec.rule_width` | number, or a `"$length"` token | The width of a table's `rules` in logical px; 1 when unset. |
| `rules` | `rules` | `rules` | `Spec.rules` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | On a table (`dir="table"`, ADR 0033): grid lines of this colour between its columns and between its rows (backlog DX21) — down the middle of each gap between the columns of its widest row, from the first row's top to the last row's bottom, and across the middle of each gap between rows, the content box wide. Drawn with the table's box, under its cells and on whole pixels, so give the table and its rows a `gap` at least `ruleWidth` for the lines to show between cells; the outer edge is the table's `border`. Ignored on anything but a table. |
| `scale` | `scale` | `scale` (0 is 1) | `Spec.scale` | number, or a `"$length"` token | Scales this node and everything under it by this factor, uniformly, about its pivot, after layout (`docs/adr/0043-a-node-turns-about-its-pivot.md`); 1 is none. 0 draws nothing in Rust, Node and Lua; in C and Odin, where a zeroed field is unset, 0 is 1. Paint-only, as `rotate` is: layout, the room taken and `onLayout` are the upright node's; what it draws, clips and hits scales. Tweens with `transition` as one slot with `rotate`; `enter: { scale: 0.8 }` settles a chip in, `keyframes: [{ scale: 1.05, at: 0.5 }]` pulses. The edge ramps scale with the box, so a box scaled far up reads soft. |
| `scaleX` | `scale_x` | `scale_x` (0 is 1) | `Spec.scale_x` | number, or a `"$length"` token | Stretches this node and everything under it across by this factor, along its own axes before its turn, about its pivot, after layout (ADR 0043's 2026-10-28 amendment, backlog C149); multiplies `scale`, 1 is none, -1 mirrors it. 0 draws nothing in Rust, Node and Lua; in C and Odin, where a zeroed field is unset, 0 is 1. Paint-only, as `scale` is: layout, the room taken and `onLayout` are the unstretched node's; what it draws, clips and hits stretches, and the access rect is the bounding box. Tweens with `transition` (with `scaleY`, a leg of the transform slot), and an entrance, an exit or a keyframe stop may name it (`enter: { scaleX: 0 }` grows a bar in from its pivot). What is inside stretches with it: a stroke is drawn wider across, a glyph wide — resampled from its upright raster, as a turned one is — so stretch a box of lines or shapes and keep text outside it, or settle back to 1 (a chart's plot gliding to a new range). |
| `scaleY` | `scale_y` | `scale_y` (0 is 1) | `Spec.scale_y` | number, or a `"$length"` token | Stretches this node and everything under it down by this factor, about its pivot, after layout; see `scaleX`, which it pairs with. A chart's plot whose range doubled draws its new lines and enters at `{ scaleY: 2, dy: … }` from where the old ones were, settling to 1 with no view run between: `pivotY: 0` keeps the top still. |
| `scrollAxes` | `scroll_axes` | `scroll_axes` (`KUI_SCROLL_AXES_*`; zeroed, both) | `Spec.scroll_axes` | `both` \\| `x` \\| `y` | Which axes `onScroll` takes (backlog F107): `both` (the default), `x` or `y`. A scroll gesture on an axis the node does not take passes it by, to the scroller around it, and hears nothing here: a terminal that scrolls its history says `y`, and a sideways swipe that starts over it moves the strip it sits in. (A swipe that started elsewhere is not the node's either way: a gesture keeps the target it started with.) Meaningless without `onScroll`. |
| `scrollMods` | `scroll_mods` | `scroll_mods` (`KUI_KMOD_*` bits; zeroed, none) | `Spec.scroll_mods` | string | The modifiers `onScroll` is for (backlog F122): `"shift"`, `"ctrl"`, `"alt"` and `"super"` (⌘, the Windows key), separated by spaces or commas — `"ctrl super"`. With any named, the node hears only a scroll gesture that began with one of them held, and hears it first: ahead of every scroll container and every `onScroll` that names none, wherever under the pointer the gesture began, the innermost such node winning — so a Ctrl-wheel zoom declared on the window's root is heard over a list, and the list does not scroll. A wheel with none of them held passes the node by, as if it had no `onScroll`: a node that scrolls as well (`overflow`) scrolls for it as any container does. Its `scroll` events carry `mods`, the modifiers held when the gesture began; the gesture stays the node's to the end of its glide, whatever is let go meanwhile, and one begun without them never becomes its. A word that is none of the four is skipped. Unset, a handler like any other. Meaningless without `onScroll`. |
| `scrollbar` | `scrollbar` | `scrollbar` | `Spec.scrollbar` | `visible` \\| `hidden` \\| `auto` | When a scrolling node draws its bars: `visible` (the default — the stock overlay thumb, drawn while the content overflows), `hidden` (no thumb, no track to press; the wheel, the keyboard, `reveal` and the caret still scroll it — for a list that draws its own indicator, or a pane whose bar would sit on a border), or `auto` (shown while the scroll state is changing — the offset or the content's extent moved, the pointer is on the track, a thumb is dragged — and for a second after, then faded out over a quarter of one; a node first seen shows it the same second; what an overlay bar does on macOS). `auto` needs the driver's clock and is `visible` without one. The bars are overlays and take no layout space in any mode. From the last change until it has faded — a second and a quarter — an `auto` bar asks for frames the way a transition of that length would (nothing else could wake the core when the hold ends); while the pointer holds it, it asks for none. |
| `scrollbarActiveColor` | `scrollbar_active_color` | `scrollbar_active_color` | `Spec.scrollbar_active_color` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | The thumb under the pointer or while dragged; the default is the theme's `scrollbar_active` role. |
| `scrollbarColor` | `scrollbar_color` | `scrollbar_color` | `Spec.scrollbar_color` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | The thumb at rest; the default is the theme's `scrollbar` role, a translucent wash over whatever it sits on. |
| `scrollbarWidth` | `scrollbar_width` | `scrollbar_width` | `Spec.scrollbar_width` | number, or a `"$length"` token | The thumb's width at rest, logical px (default 4); under the pointer or dragged it is 2 px wider. The grabbable track grows to fit a wide thumb. |
| `selectable` | `selectable` | `selectable` | `Spec.selectable` | boolean | Makes this node a selection scope: the text of every node inside it is one selectable run, in tree order, and a press-drag across them selects the lot — as do Shift with Left / Right / Home / End on a focused node inside it, a character or a word at a time, a scope with nothing selected anchoring at its start (`docs/adr/0017-selection-as-a-scope.md`). Declared on the container and not on each label, because what a reader selects is a paragraph or a card rather than one run of it — three labels in a column under one `selectable` select as three lines of one text. The selection is the window's: starting one anywhere clears the last, an editor's included. Scopes do not nest; an outer one around an inner one is warned about (`nested-selection-scope`) and the innermost owns the text. Text scrolled out of view inside the scope is still part of it — selection and copy reach it, hit-testing does not. On a `cells` grid the scope selects in cells rather than in bytes: a drag takes lines (with a modifier, a rectangle), a double click the word under the pointer and a triple click the whole row, its ends are absolute lines so a scroll does not move them, and a copy trims each line's trailing blanks. |
| `selected` | `selected` | `selected` | `Spec.selected` | boolean | The current one of a set: which `tab` a `tabList` shows, which `listItem` a list has picked, which `link` is the page you are on. A `tab` always carries the state — its siblings read as "not selected" — while a list row or a link carries it only where it is set, since an ordinary list or navigation bar is not a selection and a reader saying "not selected" on every row of it is noise. |
| `selectionAnchor` | `selection_anchor` | `selection_anchor` with `KUI_VALUE_ANCHOR` in `value_set` | `Spec.selection_anchor` | number, or a `"$length"` token | On a `line` of a custom editor: the byte offset where the selection's other end sits (the caret is `caret`, possibly on another line). |
| `shadowBlur` | `shadow_blur` | `shadow_blur` | `Spec.shadow_blur` | number, or a `"$length"` token | Drop-shadow blur radius (logical px): the edge ramps over this distance and reaches this far past the shape. 0 = a hard edge. |
| `shadowColor` | `shadow_color` | `shadow_color` | `Spec.shadow_color` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | Drop-shadow color; nothing else about a shadow draws without it. On its own it is a hard shadow exactly behind the node — add `shadowBlur` / `shadowY` to lift it. Outer shadows only, and none under the node itself: a translucent or faded node shows what is under it, not its own shadow, as CSS's `box-shadow` does. |
| `shadowSpread` | `shadow_spread` | `shadow_spread` | `Spec.shadow_spread` | number, or a `"$length"` token | Grows (or, negative, shrinks) the drop shadow's shape before blurring (logical px). |
| `shadowX` | `shadow_x` | `shadow_x` | `Spec.shadow_x` | number, or a `"$length"` token | Drop-shadow horizontal offset (logical px). |
| `shadowY` | `shadow_y` | `shadow_y` | `Spec.shadow_y` | number, or a `"$length"` token | Drop-shadow vertical offset (logical px); positive casts downward. |
| `slide` | `slide` | `slide` | `Spec.slide` | boolean | With transition: also ease the node's position (reordered siblings slide). What eases is the node's place within its parent — the node it is laid against: its parent, a float's anchor, the window for a viewport float — so a move its ancestors make is followed on the frame it happens and only its own move within the parent animates (backlog C97): a switch's knob keeps to its track while the window resizes, a sliding child rides its sliding parent and adds only its own move, and a scroll moves it with the content. Put `slide` on the node that changes place within its parent: on a wrapper that holds it, the wrapper slides and it rides along. A keyed node that changes parents — a card taken to another column — carries on from where it was drawn into its place in the new one. While it eases, the node is drawn between where it was and where this frame put it — not at the declared `dx`/`dy`, or its slot in the row — so anything else positioned from those numbers drifts for the transition's length: a canvas of floats eases everything or nothing. Siblings that cross on their way paint in tree order, the one in the later place on top; `overSiblings` keeps one over the others. |
| `textColor` | `text_color` | `text_color` | `Spec.text_color` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | The colour of every text under this node that names none, as a box's CSS `color` is inherited (backlog C130): the nearest declaration above a text wins, else the theme's foreground. A `when` entry may set it, so a row that recolours its label while hovered or pressed — a danger menu item's label on its danger fill — says so once, on the row, where a text has no box of its own for a rule: `textColor: '$danger', when: [{ hovered: true, textColor: '$onDanger' }]`. A text's own `color` wins; spans keep theirs. |
| `transition` | `transition` | `transition_ms` | `Spec.transition` | number, or a `"$length"` token | Animate sizing/colors/radius changes over this many ms — and, on a scroll container, the offset a reveal or a set_scroll moves it to (needs a stable key). |
| `valueMax` | `value_max` | `value_max` with `KUI_VALUE_MAX` in `value_set` | `Spec.value_max` | number, or a `"$length"` token | A `slider`, `progress` or `meter` role's maximum. |
| `valueMin` | `value_min` | `value_min` with `KUI_VALUE_MIN` in `value_set` | `Spec.value_min` | number, or a `"$length"` token | A `slider`, `progress` or `meter` role's minimum. |
| `valueNow` | `value_now` | `value_now` with `KUI_VALUE_NOW` in `value_set` | `Spec.value_now` | number, or a `"$length"` token | A `slider`, `progress` or `meter` role's current value (the drawing stays yours; this is what assistive technology reads). A `progress` without one is busy without saying how far: indeterminate, which a reader says as such. |
| `valueStep` | `value_step` | `value_step` | `Spec.value_step` | number, or a `"$length"` token | How far one arrow key moves a `slider` role, and the grid a value the pointer sets snaps to (ADR 0034). Unset, a hundredth of the range. PageUp / PageDown move ten steps. Read by the core only where the slider declares `onChange`; reported to assistive technology either way. |
| `valueText` | `value_text` | `value_text` (KuiStr) | `Spec.value_text` | string | What a `slider`, `progress` or `meter` role's position reads as (ARIA's `aria-valuetext`). Without one a reader has only `valueNow` and the range and says a percentage — 25 in [5..60] is "36 percent" — so a value whose unit carries the meaning says it here: "25 minutes", "3 of 8 files". It replaces the number in the reading rather than joining it, and a nudge or a step of the task announces the new text. Meaningful on those three roles alone, like the three numbers; putting the reading in `label` instead renames the node on every change, which is the wrong attribute. |
| `when` | `when` | `when` | `Spec.when_` | entry list (`[{ width?: { below?, above?, band? }, window?, dark?, hovered?, …, …props }, …]`) | Props by condition (ADR 0069): a list of entries, each the conditions it tests and the props it sets while every one holds — `{ width: { below: 700, band: 16 }, dark: true, gap: 8 }`. Every entry that matches applies, in list order, over the node's own props, so a later entry wins a prop an earlier one set; `hoverBg`, `pressedBg` and `focusBg` are entries ahead of the list. The conditions: the node's own `width` / `height` (`{ below, above, band }`, each a length or a `$length` token; `below` holds under it, `above` at or over it, and a range that holds keeps holding `band` past its threshold, so a size resting on one does not flicker); `window: { width, height }`, the same against the window's content size; `dark`, `light`, `reducedMotion` (`reduced_motion`), `contrast: "more"`, `platform` (`"macos"`, `"windows"`, `"linux"` or a list), `scale: { above }`; and the node's state, `hovered`, `pressed`, `focused`, `focusVisible`, `disabled`, `selected`, each true or false — hovered as `hoverBg` reads it, over the node or anything inside it or its hover group; and its hover group's state, `groupHovered`, `groupPressed`, `groupFocused`, `groupFocusVisible` (`group_hovered` and so on) — a member of the group under the pointer, pressed, holding focus, its focus shown — so a checkbox's mark rings while its row has the keyboard, the two sharing a `hoverGroup`; none holds for a node in no group (backlog C106). The core resolves them, so a view declares a responsive, themed, interactive box once and is not re-run for a resize, a theme switch or a hover: window, environment and state entries as the node opens, before its `transition` eases what they set (layout props jump unless `slide`; under reduced motion everything jumps); own-size entries inside layout, a width entry once the node's width is final and before its children are laid across it, a height entry with one more layout pass on the frame its match changes — no frame is drawn with a stale match. An entry over the node's own size sets the layout of its children only — `dir`, `gap`, `crossGap`, padding, `wrapChildren`, `mainAlign`, `crossAlign`, `minColumn`, and `hidden` as the list of the keyed children it hides (`hidden: ["chooser"]`) — and makes the node a container in that axis: a `fit` size there is refused (`query-on-fit`) and the node takes the room its parent offers. Other entries set any box prop but handlers, access props, keys and children. What an entry may not set is left out with `rule-prop-refused`, the rest of it standing. `onQuery` tells the view when its own-size and window matches change. |
| `width` | `width` | `width` (KuiSizing) | `Spec.width` | sizing (`number` \\| `"fit"` \\| `"grow"` \\| `"N%"` \\| a size expression \\| `"$length"`) | Horizontal size: px \| "fit" \| "grow" \| "N%" \| a size expression — `"clamp(400px, 80%, 1000px)"`, `"min(720px, 100%)"`, `"max(50%, 300)"`, nested — which layout resolves against the parent's content box, the box a percentage takes its cut of (backlog F109). An expression with no percentage in it is a length; a calc does not ease under `transition`. A percentage or an expression gives, with the fit children, when its parent overflows — two `"50%"` children and a gap fit their row (backlog F110) — where a px size keeps its own. A row holding one gives as CSS's flex items do: every child that can give gives in proportion to its size, and stops at its content — the widest thing in it that cannot wrap, a label's longest word — unless `minWidth` says otherwise (backlog RG92). The process keeps 65 536 distinct expressions and never lets one go: past that a new one leaves its prop at its default, with a `size-expressions-full` warning, so declare one per layout — a px size for the part that moves each frame, a splitter's drag — not one per frame (backlog RG93). |
| `window` | `window` | `window_role` (`KUI_WINDOW_*`) | `Spec.window` | `drag` \\| `close` \\| `minimize` \\| `maximize` | Window-chrome role: interactions become window commands, not events. |
| `wrapChildren` | `wrap_children` | `wrap_children` | `Spec.wrap_children` | boolean | Children that don't fit the main axis start a new line instead of overflowing or shrinking. Rows only (a column is ignored, with a warning), and never on a scrollX row. |

## Text props

| JSX | Lua | C | Odin | type | description |
|---|---|---|---|---|---|
| `bold` | `bold` | `KuiTextStyle.bold`; `KuiSpan.flags` (`KUI_SPAN_BOLD`) | `Text_Style.bold` | boolean | The family's bold, on a whole text or an editor (backlog F150) — a heading, a table's header, a title field: its bold face, or its regular drawn bold where the family has none, as a `<span bold>` is. A span inside a bold text is bold too. |
| `color` | `color` | `KuiTextStyle.color` | `Text_Style.color` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | Text color; default foreground when omitted. |
| `ellipsis` | `ellipsis` | `KuiTextStyle.ellipsis` | `Text_Style.ellipsis` | boolean | End the last line with an ellipsis when the text is cut off: a single line unless `maxLines` says otherwise. |
| `family` | `family` | `KuiTextStyle.family` (`KUI_FONT_*`); `KuiSpan.family` (with `KUI_SPAN_FAMILY`) | `Text_Style.family` | `sans` \\| `serif` \\| `mono` \\| a family name \\| a `$family` token | Font family: `sans`, `serif` or `mono`, kui's own, or the name of an installed family or one loaded with `loadFontsDir` / `loadFontFile` — `"Berkeley Mono"` — drawn in its face in the frame that names it (ADR 0037). A name is matched as `addSystemFont` matches it and registered in the session on first sight, exactly as the font database spells it (`"menlo"` is not `"Menlo"`); the session's first registration of any font maps the installed font files once (~30 ms on a Mac, backlog DX24), which a family named in a view pays in that frame. `systemFonts()` lists the names there are. A name nothing matches shapes as sans and raises `unknown-family`. A `$name` is a family token (ADR 0049): the face its fallback list picked, the first of its names that resolves. It and `font` set the same thing, so declare one. |
| `features` | `features` | `KuiTextStyle.features` (a `KuiStr`, the same spelling) | `Text_Style.features` | string | OpenType features for the shaper, as `tag=value` pairs separated by spaces or commas — a bare `tag` is 1, `-tag` is 0: `"liga=0 calt=0"` keeps a coding font from joining `->` and `!=` (what a terminal built on runs needs to hold its grid), `"tnum"` lines figures up in a gutter, `"ss01"` picks a stylistic set. Unset, the font's own defaults apply. At most 8; part of what the text is shaped as, so two texts differing only here are shaped twice. |
| `font` | `font` | `KuiTextStyle.font` (from `kui_font_add*`); `KuiSpan.font` | `Text_Style.font` | resource handle | A registered font handle (addFont / addSystemFont); overrides `family`. |
| `initialLetter` | `initial_letter` | `KuiTextStyle.initial_letter` | `Text_Style.initial_letter` | number, or a `"$length"` token | The first letter as an initial — a drop cap — this many lines tall (backlog F164), as CSS's `initial-letter`: its top level with the first line's capitals, its foot on the last one's baseline, the lines beside it moved in past it and the ones below at full width again. The letter is the text's first, with any opening quote or bracket before it; it keeps its span's face and colour and is sized to the drop. Still one text: a caret, a hit, a selection and the access tree read it where it is drawn, and the text is at least as tall as the lines it drops through. 0 and 1 are none (the default); a text with `maxLines` or `ellipsis`, a right-to-left one and an `edit` have none. |
| `lineHeight` | `line_height` | `KuiTextStyle.line_height` | `Text_Style.line_height` | number, or a `"$length"` token | Line height (logical px); default size * 1.35. |
| `maxLines` | `max_lines` | `KuiTextStyle.max_lines` | `Text_Style.max_lines` | number, or a `"$length"` token | Lay out at most this many lines (0 = unlimited); with `ellipsis`, a line clamp. |
| `strikethrough` | `strikethrough` | `KuiTextStyle.decoration` (`KUI_DECO_STRIKETHROUGH`); `KuiSpan.flags` (`KUI_SPAN_STRIKETHROUGH`) | `Text_Style.strikethrough` | boolean | A line through the text, where the face puts its strikeout. Paint only; on a `<span>` the span alone, per line. |
| `underline` | `underline` | `KuiTextStyle.decoration` (`KUI_DECO_UNDERLINE`); `KuiSpan.flags` (`KUI_SPAN_UNDERLINE`) | `Text_Style.underline` | boolean | A line under the text, where the face puts its underline and as thick as it says, in the text colour. Paint only. On a `<span>` it covers the span alone and follows it across a wrap, one rect per line. `underlineColor` gives it a colour of its own and `underlineStyle` a shape; either implies it. |
| `underlineColor` | `underline_color` | `KuiTextStyle.underline_color`; `KuiSpan.underline_color` | `Text_Style.underline_color` | color (`#hex` or `0xRRGGBBAA`), or a `"$color"` token | The underline's own colour — a diagnostic's red under keyword-coloured text (backlog K4). Implies `underline`. On a `<span>` the span's; a span with no colour of its own takes the text's. |
| `underlineStyle` | `underline_style` | `KuiTextStyle.underline_style` (`KUI_UNDERLINE_*`); `KuiSpan.underline_style` | `Text_Style.underline_style` | `solid` \\| `wavy` \\| `dotted` | The underline's shape (backlog K4): `solid` (the face's line), `wavy` (three strokes tall around the line, a six-stroke period — a diagnostic's squiggle, a terminal's undercurl) or `dotted` (dots two strokes across, four apart). Implies `underline`. A wave or dots are runs of the segment primitive a `line` draws, so no backend learns a kind; the cost is two quads per period. |
| `wrap` | `wrap` | `KuiTextStyle.wrap` (`KUI_WRAP_*`) | `Text_Style.wrap` | `word` \\| `glyph` \\| `none` \\| `break-spaces` | Line breaking at the node's width: between words (default), anywhere, never (one line per paragraph, clipped to the node), or between words with whitespace taking its room (`break-spaces`: a space that does not fit starts the next row rather than hanging past the edge — an editor's wrapped line). On a single-line `edit` — a field, which otherwise takes one line and scrolls it — declaring it is what makes the field fold to its width like a document, by this mode, while Enter still submits (see `edit`). |

## Composite props (hand-written per binding)

| JSX | Lua | C | Odin | description |
|---|---|---|---|---|
| `alwaysOnTop` (root box only) | `always_on_top = true` (root table) | `kui_set_always_on_top` | `kui.set_always_on_top` | Declares that this frame wants the window kept above every other app's — a floating palette, a picture-in-picture player, a timer (backlog C30). Frame state the way `title` is, applied by the driver on change and free on the frames it does not change, but with a default of false rather than "leave as-is": a frame that stops declaring it lowers the window again, so a pin button is a toggle on the app's own state and nothing has to remember to undo it. Whether the platform has a level to set is `env.window.always_on_top`, which is what the pin button should draw its state from — Wayland has no call for it at all, so there the window never moves and the reading says so; it is the driver's record of what it set, not a query, so a level the OS dropped afterwards (a fullscreen space, a tiling manager) is not reported. A popup keeps its own level whatever its owner declares. |
| `borderW`, `borderColor` | `border = { w=, color= }` | `border_w`, `border_color` | `Spec.border_w`, `Spec.border_color` | Border width and color (drawn inside the rect). |
| `dir="row" \| "column" \| "table"` | `row { }` / `column { }` / `grid { }` | `dir` (`KUI_ROW` / `KUI_COLUMN` / `KUI_TABLE`) | `Spec.dir` (`.Column` / `.Row` / `.Table`); `kui.row` and `kui.column` set it | Main axis; column is the default. `table` is a column whose rows' children line up in columns (the `table` element). |
| `float="below" \| "above" \| "parent" \| "viewport"` or `{ anchor, at, self, dx, dy, fit, escape }` | `float = "below"` or `float = { anchor=, at=, self=, dx=, dy=, fit=, escape= }` | `float_mode`, `float_anchor_x/y`, `float_self_x/y`, `float_dx/dy`, `float_fit`, `float_escape`; `kui_spec_float_preset` fills them from a preset name | `Spec.float`, a `Float` (`mode`, `anchor_x/y`, `self_x/y`, `dx/dy`, `fit`, `escape`); `kui.float_preset` fills one from a preset name | Out-of-flow positioning against the parent or the viewport; `fit` flips/clamps to stay on screen. What a node and its subtree paint is cut by the nearest box above it that clips or scrolls, whatever its float, move, keyframes or turn (`docs/adr/0074-paint-stays-in-the-box-it-is-in.md`): a float anchored to its parent (`parent`, `below`, `above`) is cut where a child of its parent would be — by the parent's own rect when the parent clips or scrolls, else by the nearest ancestor that does — and hit only there, so a node on a `clip` canvas panned past the canvas's edge is cut there and a chart's sliding layer is cut by its plot. One that must show past that edge says so with `escape`: a menu, a popover or a tooltip hung off a control in a scroller. A `viewport` float is placed against the window and leaves every ancestor's clip without saying it. A `line`, `polygon` or `path` in its parent's box never escapes. (`clip`, which code before ADR 0074 declared on a float, is what a parent-anchored float does now: still read, and dropped.) The four preset names resolve in `FloatConfig::preset`, and `anchor` takes any of them — an override left out keeps the preset's own value, so `{ anchor: "below", dx: 4 }` still hangs below with its 6px gap. A float is a layer of its own, cut or not: above the in-flow tree and every float that opened before it, under every float that opened after, and hit-tested in the same order — so a tooltip that appears over an open menu is over it, and a popover over a scroller's bar takes the press there. A float anchored to its parent that does not `escape` is its box's content, and opens just above the floats the same layer holds already — the in-flow tree's, or those of the float it is in — rather than over every float: a chart's tick labels laid out after a dialog opened stay under the dialog (backlog F257). A scroller's bars and the focus ring belong to the layer that owns them. There is no z-index; a float declared under a fresh key reopens on top (`docs/adr/0023-layers-stack-in-the-order-they-open.md`). |
| `imeOff` (root box only) | `ime_off = true` (root table) | `kui_set_ime_off` | `kui.set_ime_off` | Declares that this window takes the keyboard as keys, with the platform's input method off (backlog F125): no composition and no candidate window, and on a Mac no dead key waiting for the next and no press-and-hold — an input method too, so a held letter repeats instead of opening the accent picker, whatever the user's `ApplePressAndHoldEnabled` says. A `key` event's `text` is still the layout's character; what goes is everything the OS would have composed from it. What a modal editor's normal mode wants — `jjjj` is how one moves, and an IME left on eats the keymap — while its insert mode stops declaring it and gets accents, dead keys and the IME back. Frame state the way `alwaysOnTop` is, default false: declare it on every frame the mode wants it, and the frame that stops gives the input method back; the runner applies it to the window on change, never per frame, and a composition in progress when it turns off ends without a commit, as an empty `preedit`. The window's, not a node's: a stock editor focused under it composes nothing either. A popup's keys arrive through its owner, so the owner's declaration is the one they are read under. On Windows and Linux the window's IME is disabled the same way, and only that: their dead keys are the layout's, and still compose. A focused `secure` editor asks for it too, as a password field takes keys and not compositions (backlog F167), and the read-back says so. A C host with its own loop reads the ask with `kui_ime_off_get` and applies it itself. |
| `index` | `index` | `kui_open_indexed` | `Spec.index`, a `Maybe(u64)`, which opens the node indexed | Stable identity by *data* index rather than by name: the key auto-keying would have given this node as the `i`th child, given to it wherever it actually sits. What a virtualised list is for — a view that builds rows 900..930 of ten thousand opens each with its own row number, so the row keeps its hover, focus, edit buffer and tweens as the built range slides over it, and a list that builds every row agrees with one that builds a screenful. Wherever `key` names a node this numbers it (a box, a `line`, a `cells`, a `fragment`); declared beside `key` the index wins. Indices and names are separate namespaces, so a spacer keyed `"lead"` cannot collide with row 0 — but two rows on one index do, exactly as two on one name would. |
| `key` | `key` | `kui_open_keyed` label | `Spec.key`, which opens the node keyed | Stable identity for retained state (scroll offsets, editors, transitions; keys are hashes of the path from the root). Retained state outlives the key's absence, under a budget on the states nobody declares (see `<edit>` and the overflow props). |
| `keyFocus` | `key_focus` | `kui_set_key_focus` | `Spec.key_focus`, which calls `kui.set_key_focus` on the node | Focuses this node (an `onKey` sink, an editor, any focusable node) when it starts being declared: declared every frame it takes focus once, so a later Tab press is not clobbered. Declaring it on the frame a `modal` stops being declared is how a view says where focus lands on the way out — the edge stands, and the focus the modal displaced is not handed back over it (`docs/adr/0003-modal-surfaces.md`, decision 4). To move focus at any time call the binding's focus verb (`ctx.focus`, `kui_focus`, `env.set_focus`). |
| `optionAsAlt="left"` — `"none"`, `"left"`, `"right"`, `"both"` (root box only) | `option_as_alt = "left"` (root table) | `kui_set_option_as_alt` (`KUI_OPTION_AS_ALT_*`) | `kui.set_option_as_alt` (an `Option_As_Alt`) | Declares which Option keys act as Alt in this window on macOS (backlog F113). On a Mac, Option composes: ⌥m types `µ`, and ⌥u, ⌥e, ⌥i, ⌥n and ⌥` are dead keys that start an accent and wait for the next key, so the press never reaches the app as a key and a keymap binding `<A-u>` never hears it. An Option key named here is Alt instead: it composes nothing and types nothing, and a key under it arrives as a chord of the key the layout prints unmodified — a terminal's "Option as Meta", an editor's Alt bindings. `"left"` or `"right"` leaves the other side composing, so a user keeps `ü` on one Option; `"both"` takes both; `"none"`, the default, is the Mac's own behaviour. Frame state the way `alwaysOnTop` is: declare it on every frame, and the frame that stops gives the Option keys back to the layout; the runner applies it to the window on change, never per frame. A popup's keys arrive through its owner, so the owner's declaration is the one they are read under. Nothing on Windows or Linux, whose Alt composes nothing. A C host with its own loop reads the ask with `kui_option_as_alt_get` and applies it itself. |
| `clip`, `scrollX`, `scrollY` | `clip`, `scroll_x`, `scroll_y` (`scroll` = `scroll_y`) | `overflow` bits `KUI_CLIP` \| `KUI_SCROLL_X` \| `KUI_SCROLL_Y` | `Spec.overflow`: `{.Clip}`, `{.Scroll_X}`, `{.Scroll_Y}` | Clip children; scroll (implies clip) with retained offsets and live scrollbars. A `radius` on the same node rounds the clip, so a rounded card does not show square corners poking out of it; nesting two rounded clippers keeps only the corners neither of them moved, and hit-testing stays rectangular. Every frontend ORs the same bits and hands them to `NodeSpec::overflow_bits`. The wheel goes to the scroller under the pointer on the axes it scrolls, and the rest of the notch to the one around it: a `scrollY` list inside a `scrollX` strip moves the strip on a sideways swipe (backlog DX13). A scroll gesture — a swipe and its glide, a wheel spun without a pause — picks that scroller when it starts, skipping one already at its limit that way for the one around it (unless it says `overscroll: contain`), and keeps it until it ends, so content moving under a still pointer does not hand the rest of a swipe to what came under it (backlog F107). An offset is kept while the key is declared; an undeclared one is kept until the budget needs the room (1024 undeclared entries, longest-undeclared evicted first). |
| `pad`, `padX`, `padY`, `padL`, `padR`, `padT`, `padB` | `pad = n` or `pad = { all=, x=, y=, l=, r=, t=, b= }` | `pad_l`, `pad_r`, `pad_t`, `pad_b` | `Spec.pad`: `kui.pad(16)`, `kui.pad(16, 8)`, or `{l = .., r = .., t = .., b = ..}` | Padding; a frontend reports the names it saw and `PadShorthand::resolve` turns them into four edges — an edge falls back to its axis, an axis to the all-round `pad`, and the specific one always wins. |
| `rowCount` | `row_count` | `kui_row_count` | `Spec.row_count`, a `Maybe(u64)`, which calls `kui.row_count` on the node | How many `index`ed rows this node's virtual list has, built or not. `uniformList` / `uniform_list` / `widgets::uniform_list` and `widgets::list` declare it on their container; a list composed by hand says it beside `scrollY`. What it buys: Select All (Cmd/Ctrl-A, the menu's row) inside a `selectable` virtual list selects the *data*, rows `0..rowCount`, rather than the rows the frame built, and the copy is a `selectionrange` ask whose `to.byte` is past the last row's length when that row is not built — cut it to the row. Without it Select All is the built rows, which is all the core can see. |
| `secureInput` (root box only) | `secure_input = true` (root table) | `kui_set_secure_input` | `kui.set_secure_input` | Declares that this frame wants the keyboard to this window kept from every other process while the window has it — macOS's Secure Keyboard Entry, what a terminal turns on at a password prompt (backlog F85). Frame state the way `alwaysOnTop` is, default false: declare it on every frame the prompt is up, and the frame that stops is what turns it off, so nothing has to remember to undo it. The runner owns the platform call and its balance: `EnableSecureEventInput` is process-wide and counted, and the runner holds one count while a window whose frame asked has the keyboard, giving it back when that window loses the keyboard, closes or stops asking, and at exit — Apple's rule, since while it is on no other process can read the keyboard at all (a launcher's hotkey, a text expander, an accessibility tool). Nothing on Windows or Linux, which have no such switch. A focused `secure` editor asks for it too, on any frame it has the keyboard (backlog F167), and the read-back says so. A C host with its own loop reads the ask with `kui_secure_input_get` and makes the call itself. |
| `size` (text) | `size` | `KuiTextStyle.size`; `KuiSpan.size` | `Text_Style.size` | Font size in logical px; the text style is constructed from it, so declare it for the other style props to apply at that size. |
| `title` (root box only) | `window_title` (root table) | `kui_window_title` | `kui.window_title` | Declares the window title for this frame; the driver diffs and applies. |
| `tooltip="hint"` | `tooltip = "hint"` | `KuiSpec.tooltip` (`kui_tooltip` / `kui_tooltip_with` draw a hint that is not hover-gated) | `Spec.tooltip` (`kui.tooltip` / `kui.tooltip_with` draw a hint that is not hover-gated) | Floats a hint below the node while the pointer is over it or over anything inside it — a child button, a field, a row with a `hoverBg` included, as a browser's `title` shows over a descendant; with tooltips nested, the innermost one under the pointer is the one shown (backlog F179). A descendant floated against the viewport or another node — a dialog, a toast — is placed somewhere else, and the hint does not show over it; one floated against its parent, a badge, still counts as inside (backlog RG160). All three effects — hover tracking, the accessible description, and the float itself — come from `PropsOut::apply_tooltip`, so no frontend can implement two of them; a Rust view has all three in `NodeSpec::tooltip` (`NodeSpec::apply_tooltip` is the spec half, for a caller that floats the hint itself). The `description` row is that middle effect on its own, for a hint that is spoken and never drawn. On a box or a `fragment` the float is the node's last child; a leaf holds no children — a `line`, `polygon`, `path`, `cells` grid, `image` or `edit` — and its hint floats beside it instead, anchored to it, and lands below its box the same way, out of every clip and flipping above near the window's bottom (backlog RG113; `PropsOut::for_leaf`). A leaf draws its description, which is the hint unless a `description` applied after it overwrote the slot. A `line`, `polygon` or `path` is hovered by its shape, so its hint shows while the pointer is on the stroke or inside the outline, not anywhere in its box. The hint is drawn at the opacity the node's parent has, not the node's own: a box or a leaf at `opacity: 0.4` has a hint that is not, and a panel fading around it takes the hint with it (backlog F178). A box at `opacity: 0` floats none, and neither does one leaving with an `exit` (backlog RG160). |
| `windowEvents={{ onResize?, onFocus?, onSystemSettingsChange?, onFonts?, onModifiers?, onOpen? }}` (root box only) | `window_events = { on_resize=, on_focus=, on_system_settings_change=, on_fonts=, on_modifiers=, on_open= }` (root table) | `kui_root_with` (`KuiWindowEvents`) | `kui.root_with` (`Window_Events`) | The messages the window's own events arrive as (ADR 0048), one boxed group on the root rather than six rows on every node: `onResize` hears `resize: {width, height, scale}`, `onFocus` this window gaining or losing the keyboard as `window: {phase: "focused" \| "blurred"}`, `onSystemSettingsChange` `system: {appearance, accent, motion, locale, assistive, contrast}`, `onFonts` the system's fonts changing (the message as declared), `onModifiers` `modifiers: {shift, ctrl, alt, super}`, and `onOpen` the OS's documents as `open: {paths}` — read on the main window's root alone, since the OS opens documents to the app. Each arrives as its message with the data in the field named for the event, as a node's handler does. A root that declares no group, or a group that leaves a key out, hears none of those events; `env` reads every fact they report either way. Read from the last frame the window finished, so a resize the next frame begins with arrives as the message the frame before declared. A window's opening and closing are its `windows` entry's (`onWindow`), and the menu bar's choice is the `menuBar` element's (`onMenu`). Declared on any node but the root it is ignored, and `window-events-off-root` says so. |
| `windows={[{ name, kind?, anchor?, width?, height?, activates?, onWindow?, onDismiss? }]}` (root box only; `windows: (model) => [...]` in the loop config) | `windows = { { name=, kind=, anchor=, width=, height=, activates=, on_window=, on_dismiss= } }` (root table) | `kui_window_declare`, `kui_window_declare_with` | `kui.window_declare`, `kui.window_declare_with` | Declares which windows exist this frame, by stable name (`docs/adr/0004-multi-window.md`). A window opens on the first frame any window's frame declares it — its config is read then and never again, since the user owns its geometry once it exists — and closes on the first frame none does. The driver drains the `Open` / `Close` that result, and the entry's `onWindow` message hears both edges as `window: {phase: "opened" \| "closed", id}` (ADR 0048) — read on every declaration, unlike the config, and for a window that closed the last one declared. A window the user closed does not reopen while it is still declared: stop declaring it, then declare it again. `kind: "popup"` makes it a menu surface instead: borderless, off the taskbar, owned by the window that declared it and closed with it, placed in screen coordinates against `anchor` — the `{x, y, w, h}` an `onLayout` node reported — and non-activating unless `activates` says otherwise, so the field that opened it keeps the focus ring while the arrows walk the list. A press outside it or Escape arrives as the entry's `onDismiss` message with `dismiss: {reason, id}` and closes nothing, exactly as a `modal` node's does: stop declaring the window. Reach for a popup only for the placements a float cannot make — a list taller than the window, a menu with nowhere in-window to go, a panel beside the app; everything else stays `fit` plus a `modal` float, which costs one tree instead of an OS surface. `kind: "surface"` is an island a host draws into its own world (`docs/adr/0076-an-island-is-a-window-the-host-draws.md`): never an OS window; the host runs it as a context of its own, its size follows its declaration on every frame (a `SetSize` when it changes), and it closes with the window that declared it. The windowed runner has no world to draw one into, so it warns `surface-without-host` and opens nothing. |

## Elements

| JSX | Lua | C | Odin | notes |
|---|---|---|---|---|
| `<box>` | `row { }`, `column { }` | `kui_open*` … `kui_close` | `kui.box` / `kui.row` / `kui.column` in an `if`, closed at its end; `kui.open` … `kui.close` unscoped | A container: every container prop applies. |
| `<box dir="table">` | `grid { }` | `kui_open*` with `dir = KUI_TABLE` | `kui.box` with `dir = .Table` | A column whose rows' children line up in columns (`docs/adr/0033-a-table-is-a-column-whose-cells-align.md`): its children are the rows, each row's in-flow children its cells, the nth cell of every row column n, and a column as wide as its widest cell — so a label column sits at its longest label with nothing measured and no width picked by hand, in every binding, since the alignment is the layout's and not a widget's. A cell's `width` says how its column sizes: `fit` (the default) and a fixed number are content the column's fit width is the max of; `grow` makes the whole column grow with the table, `grow` factors splitting the room the fit columns leave; a percent takes its cut of the row; and a column's `minWidth` / `maxWidth` are the strictest its cells declared. Fit columns that overflow the row are compressed toward their floors largest first, as a row's children are, unless the table scrolls x; a fixed column never is. A bare text is a cell too, held at its column's width, so a text straight inside a row is a column; an image straight in a row is a cell the same way, its box the column wide and its own aspect tall, the pixels meeting the box by its `fit` row (wrap an icon in a box to keep its own width). The rows are the table's `row` children, ordinary rows — give them `width="grow"` for the columns to grow into (a `fit` row sits at the columns' width) — with their own `gap` between cells, their own padding, background, click, hover and access rows; a row of a table never wraps (`wrap-ignored`). Anything else straight under the table — a text, a `column` section, another table — is a child with its own width and no cells. The table's own `fit` width is its columns', whatever its rows' sizing, so a table with no width is the aligned list; a `scrollX` table's rows are at least as wide as its columns, and it scrolls to them. Everything else is a column's: `gap` is the space between rows, `scrollY` scrolls them, a float in a row is not a cell. Spelled `grid { }` in Lua, since `table` is Lua's own. |
| `<text>` with `<span bold italic underline strikethrough bg bgRadius bgPad color family font size>` children | `text("s", {…})`, `text({ "a", { "b", bold = true, underline = true, bg = 0x.., bg_radius = 4, bg_pad = 2 }, { "code", family = "mono", size = 13 } })` | `kui_text`, `kui_rich_text` | `kui.text`, `kui.rich_text` | Plain or rich text; spans shape as one paragraph, so wrapping crosses style boundaries. A text is content plus a style and no box of its own, so the rows it reads are the style rows (`size`, `lineHeight`, `color`, `family`, `font`, `wrap`, `maxLines`, `ellipsis`, `initialLetter`, `underline`, `strikethrough`, `features`) and nothing else: a container row, an access row (`label`, `role`, `live`), `key` or `onClick` on a text is dropped with an `unknown-prop` warning naming the rows it does take — put them on the box around it. `wrap`, `maxLines` and `ellipsis` control line breaking. A span's `bg` is a background behind its glyphs alone, one rect per line it spans, so it follows the span across a wrap the way a box around a run cannot. With `bgRadius` (`bg_radius` in Lua, `KuiSpan.bg_radius` in C, `Span::bg_radius` in Rust; logical px) the background is rounded and joined into one shape with every rounded background of the same colour and radius it meets: a piece whose edge touches it exactly on the line above or below and overlaps it sideways, or that meets it end to end on its own line, in this text or another. Its corners are then convex where a line reaches past its neighbour, a fillet where it falls short, and round where nothing meets it — a selection over many rows, or over the wrapped lines of a paragraph, is one rounded outline, joined after every text of the frame is laid out and painted, so it is never a frame behind. Nothing names the shape: two that touch are one. With `bgPad` (`bg_pad` in Lua, `KuiSpan.bg_pad` in C, `Span::bg_pad` in Rust; logical px) the background reaches that far past its first and last glyphs, at the two ends of the rect it is drawn in and on each line a wrapped span covers — never between spans of one background merged into one rect, and never over another background it meets on its line: the edge they share stays, and two closer than their padding share the gap (backlog F227). Paint only: the layout, the line breaks and a hit do not move; `underline` and `strikethrough` on a span or on the whole text are lines where the face puts them. A span takes a face and a size of its own: `family` (a stock name or an installed family's, as the text's) or `font` (a handle, which wins) — inline code in `mono` inside a sans paragraph — and `size` in logical px, its line height scaled at the paragraph's ratio (`Span::family` / `Span::mono` / `Span::size` in Rust, `KuiSpan.family` with `KUI_SPAN_FAMILY`, `.font` and `.size` in C). Its glyphs are shaped in that face, so a caret, a hit, a selection and the measurement read the same glyphs and byte positions stay exact across the change; a line is as tall as its tallest span, and a span's background is its own height around its glyphs. A paragraph with a sized span is shaped whole, never in chunks. A text with no line breaks that is 4096 bytes or longer (and no `maxLines` or `ellipsis`), plain or spans alike, is shaped in ~1 KB chunks as they come on screen, so a minified bundle or a log line with a blob in it costs the screenful it shows and a keystroke into it — or a span moving along it, an editor's caret — costs the chunk it lands in; wrapped, the rows are broken from the chunks' positions, so a 100k-character paragraph costs the rows it shows. Its size is estimated from the first chunk until the rest shape (exact under monospace), and the access tree carries its value without its runs. |
| `<button onClick key\|index label description tooltip disabled accent>` | `button { label=, on_click=, key= \| index=, text=, description=, tooltip=, disabled=, accent= }` | `kui_button`, `kui_button_with` | `kui.button` | The stock button: `widgets::button_spec(&theme, &metrics)` — the theme's accent trio as its three backgrounds, declared on the node and resolved by the core — keyed by its text (`key` overrides). It paints from the palette like every stock widget (backlog AR41): the OS's accent where the host reports one, the app's where it set or pinned one, kui's blue otherwise; the label goes black or white by the background's luminance. Its look is its spec, so the layout and paint rows are closed — declared, they are dropped with an `unknown-prop` warning naming the rows it does read — and those are the access rows: `label` when the text is not the name, `description`, `tooltip`, and `disabled` (inert, and dimmed to half). The one paint row it takes is `accent`, which on a button changes nothing (it is the accent already) and is kept for the box's sake. In Lua `label` is the name and the text both unless `text` says otherwise; in C the rows ride a `KuiSpec` whose other fields `kui_button_with` ignores. A button that needs any other row is a box with `role="button"` and the same rows spelled out. |
| `<edit key initial value multiline autofocus keepTab tabMovesFocus placeholder secure onChange onSubmit onCancel onBoundary>`, `<input label initial value onChange onSubmit onCancel>` | `edit { key=, initial=, value=, keep_tab=, tab_moves_focus=, placeholder=, secure=, on_change=, … }`, `input { label=, initial=, value=, on_change=, on_submit=, on_cancel= }` | `kui_text_edit`, `kui_text_edit_placeholder`, `kui_text_input`, `kui_text_input_with` | `kui.text_edit`, `kui.text_input`, `kui.text_input_with` | Retained editor state by key. Its edits arrive as its `onChange` message with `change: {text}` in it, the whole text after the edit; Enter as its `onSubmit` message and Escape as its `onCancel` one; an editor that declares none of them hears nothing (ADR 0047). `value` is the text declared every frame: where it differs from the editor's, the editor is brought to it as a splice that keeps the caret, and a correction made in the `update` the edit reached joins that edit's undo step — so the model is the editor's, with `onChange` storing the text (without it the field reverts every keystroke, `edit-value-without-handler`). `initial` seeds a new editor only, and is never read beside `value` (`edit-value-and-initial`) — a key declared again keeps the draft the user typed, and `setEditText(name, text)` is what resets one (it leaves the caret at the end and clears undo). Name it by the label its `key` prop declares — `setEditText('note', text)` — or by the hex key an event carried. It reaches an editor that does not exist yet: the text is held for the frame that declares that name and seeds it there, over `initial`, so the `update` that opens a rename field can fill it in the same turn, which is what the label spelling is for — the hex key comes from an event an editor being opened has not fired. A name nothing declares on that frame drops its text with an `edit-text-without-editor` warning. A single-line editor is a field and a `multiline` one a document, which decides how each is laid out as well as how it reads: a field takes one line whatever its box, sizes to the text it holds when its width is `fit`, and scrolls that line under the caret when it is not, while a document wraps to its box. The one exception is a field with `wrap` declared (`wrap="word"` or `"glyph"`): it folds to its width the way a document does and keeps a field's keyboard — Enter still submits, a newline is still never admitted, the caret still opens at the end — so a rename field breaks where the label it renames breaks, and with `width="fit"` plus `maxWidth` it sizes to its wrapped draft on the keystroke frame. A single-line editor opens with the caret after its seeded text, as a native field does; a multiline one is a document and opens at its top — a held `setEditText` is the call, not a seed, so it opens at the end either way. State is kept while the key is declared; an undeclared one is kept until the budget needs the room (256 undeclared editors, longest-undeclared evicted first) — except a `secure` one, forgotten with its text zeroed on the first frame that does not declare it (backlog F177). `autofocus` asks once: the editor takes focus on the frame the flag starts being declared — a new editor, or one whose flag just turned on — and only while nothing holds focus, so a blur afterwards stands and a focused control is never robbed (`docs/adr/0022-focus-regions.md`, decision 9); `focus(key)` is the call for taking it at any other time. A focused editor keeps the keys it acts on — the editing keys, what it types, the clipboard and undo chords — and a chord it does not (⌘N, Ctrl+K) goes to the nearest `onKey` sink above it, as a chord bubbles from a control (`docs/adr/0011-keys-bubble-to-the-enclosing-sink.md`, amended 2026-10-09). `keepTab` makes an editor's Tab the app's: Tab and Shift-Tab do not walk the focus ring from it, and the press goes to the sink above it the same way, so a list or an outline built from fields indents on Tab. A `multiline` editor takes Tab, as a code editor does (backlog C99): Tab types four spaces and Shift-Tab takes up to four back from the start of the line, and the keyboard keeps three ways out — Escape then Tab moves focus (the Escape arms the next Tab only, and a second Escape lets go), the window's "Tab moves focus" toggle (Ctrl+M, Ctrl+Shift+M on macOS; `env.tab_moves_focus`) makes every such editor walk the ring, and Tab under Ctrl, Alt or the platform primary walks it always. One that declares `tabMovesFocus` (Lua `tab_moves_focus`) is left by Tab and Shift-Tab as a field is, as a browser's textarea is. An arrow, Backspace or Delete that meets the edge of the text emits `boundary` (see the events). `placeholder` is what an empty editor shows where its text would be, in the theme's `faint` — never part of the value, gone with the first character typed or composed, and read as the field's accessible description when it declares none. `secure` makes it a password field (backlog F167): the text is drawn as a bullet (•) per grapheme and measured, hit and selected as the bullets; a copy or a cut from it is refused and a paste taken; no input method composes into it, and it keeps no undo history; the access tree reads it as a `passwordInput` whose value is the bullets; and while it has the keyboard the window asks for secure keyboard entry and the input method off, as `secureInput` and `imeOff` would. `editText` still reads the text. Declare it off on a later frame — an app's show-password toggle — and the same editor draws its text again, the caret where it was; on again, it masks it. A secure editor is a field: `multiline` is ignored, and the word keys and a double click take the whole text, as there are no words to show. The text the app was handed (each `change`'s, `editText`'s answer) is the app's copy, and the app's to clear. In C it is `KUI_EDIT_SECURE`, in Odin `.Secure`. |
| `<select label options={[…]} current onMenu>` | `dropdown { label=, options={…}, current=, on_menu= }` | `kui_select`, `kui_select_with` | `kui.select`, `kui.select_with` | The stock select (`widgets::select_items`, backlog F72): a field showing the choice in force that, clicked, opens the core's own menu of the options under it with the current one checked — the menu a right-click opens, drawn in the frame or the platform's where the host shows menus itself, dismissed by Escape or a press outside, its rows walked by the arrows and read as a menu. `label` is the key and the accessible name both; `options` is a list whose entries are strings (an option by its label, posting it) or menu-item objects `{ label, id, enabled }` (posting `id`), and a `{ role: "separator" }` is a separator; `current` is the index in force, counted from 0 in JSX and C and from 1 in Lua, or none — one past the options or on a separator is none, with a `select-current-ignored` warning on the field; an empty `options` is refused, and a key of an option object no row reads (`disabled`, where the key is `enabled`) is an `unknown-prop` warning. The app holds no open state: the choice arrives as the field's `onMenu` message with `menu: {role: "custom", item: <the option>}` in it, on the field's key — a field that declares no `onMenu` still reports, as `{menu: …}` alone (ADR 0047) — and drawing the field again with the new `current` is the whole loop. A reader hears a button named by the field, described by its choice, expanded while the menu is open. Its look is its spec, so it reads no other row: a layout, paint or access row on it is dropped with an `unknown-prop` warning. Lua spells it `dropdown`, since `select` is Lua's own. |
| `<checkbox checked mixed onClick key label description tooltip disabled ellipsis maxLines wrap>text</checkbox>` | `checkbox { label=, checked=, mixed=, on_click=, key=, text=, description=, tooltip=, disabled=, ellipsis=, max_lines=, wrap= }` | `kui_checkbox`, `kui_checkbox_with` | `kui.checkbox` | The stock checkbox (`widgets::toggle_with`, ADR 0034): a box drawn from the state the view declares — `checked`, or `mixed` for the select-all box over a list some of whose rows are selected, drawn as a dash and read as mixed — and its label beside it, keyed by its text (`key` overrides). The state is the app's: a press by the pointer, Space, Enter or assistive technology posts `onClick`, and the view flips its model and draws it again. Its look is its spec, so the layout and paint rows are closed and dropped with an `unknown-prop` warning; the rows it reads are its state, the access rows, and its label's line breaking (backlog F184): `ellipsis` keeps the label on one line, cut with an ellipsis where the checkbox is squeezed — a list of long names in a narrow column — and `maxLines` (with `ellipsis`, a clamp) and `wrap` are the text's own rows, read on the label; the label's size, colour and face stay the stock's (C: `kui_checkbox_with`'s `KuiTextStyle`, of which it reads those three). A cut label is still the checkbox: a press on it toggles, its name is the whole text, and while it is cut the whole text floats as its hint on hover, unless a `tooltip` says something else. In Lua `label` is the name and the text both unless `text` says otherwise. The box is the metrics' control text plus one (16 px comfortable), so `compact` and `scaled` move it with the stock button. |
| `<radio checked onClick key label description tooltip disabled ellipsis maxLines wrap>text</radio>` | `radio { label=, checked=, on_click=, key=, text=, description=, tooltip=, disabled=, ellipsis=, max_lines=, wrap= }` | `kui_radio`, `kui_radio_with` | `kui.radio` | The stock radio (`widgets::toggle_with`, ADR 0034): a circle drawn from `checked`, and its label, keyed by its text. Put radios in a `radioGroup`, which makes them one Tab stop whose arrows, Home and End move the choice and press the radio they land on (ADR 0007), so radios whose `onClick` each set the choice answer the keyboard with no more code. The state is the app's, as a checkbox's is; the rows are the checkbox's, `mixed` aside. |
| `<radioGroup label>…radios…</radioGroup>` | `radio_group { label=, … }` | `kui_radio_group_open` … `kui_close` | `kui.radio_group` in an `if`, closed at its end | A container of radios (`widgets::radio_group_with`, ADR 0034): the `radioGroup` role, named by its `label`, laid out as a column with the stock gap — a `dir="row"` lays the radios across, and its arrows run across with it. It reads every box row; the role and the name are its own whatever the rows say. |
| `<switch checked onClick key label description tooltip disabled ellipsis maxLines wrap>text</switch>` | `switch { label=, checked=, on_click=, key=, text=, description=, tooltip=, disabled=, ellipsis=, max_lines=, wrap= }` | `kui_switch`, `kui_switch_with` | `kui.toggle` | The stock switch (`widgets::toggle_with`, ADR 0034): a track and a knob drawn from `checked`, the knob sliding across when it changes, and its label; read as a switch, on or off. The state is the app's, as a checkbox's is; the rows are the checkbox's, `mixed` aside. |
| `<slider label valueNow valueMin valueMax valueStep valueText onChange width description tooltip disabled/>` | `slider { label=, value_now=, value_min=, value_max=, value_step=, value_text=, on_change=, width=, … }` | `kui_slider` | `kui.slider` | The stock slider (`widgets::slider_with`, ADR 0034): a track, a fill to `valueNow` and a thumb, as wide as a menu (`width` sizes it), keyed by its `label`, which is also its accessible name. With `onChange` the core does the arithmetic: a press proposes the value under the pointer, a drag each new step, the arrows one `valueStep`, PageUp / PageDown ten, Home / End the ends, all clamped to `valueMin`..`valueMax` (0..100 unset) and snapped to the step, as its `onChange` message with `change: {value, phase: "move" \| "end"}` in it (ADR 0047). The value is proposed, never applied: the view stores it and declares it as `valueNow`. Its look is its spec, so the rows it reads are the value rows, the access rows and its width. |
| `<progress label valueNow valueMin valueMax valueText role width description tooltip/>` | `progress { label=, value_now=, value_min=, value_max=, value_text=, role=, width=, … }` | `kui_progress` | `kui.progress` | The stock progress bar (`widgets::progress_with`, backlog F267): the slider's track and a fill to `valueNow` in `valueMin`..`valueMax` (0..100 unset), with no thumb, as wide as a menu (`width` sizes it), keyed by its `label`, which is also its accessible name. It is the `progress` role, read-only: a reader hears the label and the value (`valueText` where the number does not say it — "3 of 8 files"), and the new one each time the view declares another; it takes no focus and no press. With no `valueNow` it is busy — indeterminate to a reader, and drawn as a third of the track filled in its middle. `role="meter"` makes it a meter, a level rather than a task's progress (a battery, a disk): drawn the same, read as a level indicator; any other role is ignored. Its look is its spec, so the rows it reads are the value rows, the access rows and its width. |
| `<image src={id} sampling fit>` | `image { id=, sampling=, fit= }` | `kui_image`, `kui_image_with` | `kui.image`, `kui.image_with` | A registered RGBA image. Sizing: `width="fit"` takes the pixel size, a fit height against a resolved width keeps the aspect, `radius` rounds it. Two rows say how the pixels meet the box (`docs/adr/0025-the-image-is-the-canvas.md`): `sampling` is `linear` (the default) or `nearest` — pixel art, an emulator, a data grid that must stay square under zoom; `fit` is `fill` (the default: the pixels stretch to the box), `contain` (the largest rect of the image's aspect that fits, centred, the rest of the box showing what is behind) or `cover` (the box filled and the pixels that do not fit cropped, centred). The box — its layout, its hit region, its access rect — is the same in every mode. The pixels come from the atlas, or from a texture of the image's own once `updateImage` has replaced them or when no atlas page could hold them; the node cannot tell and need not. Drawn at less than half its texels a pixel, a `linear` image is drawn from a level the core halved it to (`docs/adr/0044-an-image-drawn-smaller-is-drawn-from-a-level.md`): the deepest level with at least a texel a pixel, the 2×2 means taken in linear light, made once per session at the first draw that wants it and kept in the atlas in place of the whole image — so a photo registered as decoded and shown on a card is neither resampled by the app nor aliased on screen. The display's scale and any `scale` the node is drawn through count. `nearest` and an image ever updated (a stream) draw the whole image. |
| `<polygon points={[[x,y],…]} bg/>` | `polygon { points={{x,y},…}, bg= }` | `kui_polygon` | `kui.polygon`, its points a `[][2]f32` | A filled polygon through up to eight `points`, the fill in `bg` (`docs/adr/0025-the-image-is-the-canvas.md`, decision 6): an arrowhead, a pie slice, the area under a curve. Placed as a `line` is — always a float in its parent's box space (`float="viewport"` for viewport space), sized to its own bounding box a pixel out on each side, so it takes no room in a row or column, and painted in the parent's layer at its place in the tree, over the siblings before it and under those after (backlog F123). A polygon in its parent's box space is held by the parent's clip as a child is, its hit region with it, so it is cut at a scroller's edge with the row it is drawn in; a declared float is held that way only when it declares `clip` with a parent anchor, and a `float="viewport"` polygon escapes (backlog F78, `docs/adr/0010-a-segment-primitive.md` decision 5). `transition` eases the fill and, with `slide`, its position. The outline may be concave; a self-intersecting one fills even-odd, its overlaps unfilled. Hit by its outline (`docs/adr/0026-hit-testing-by-shape.md`): with `onClick`, `onDrag`, `onHover` or `hoverable` a press inside the outline hits it and one in its box past the outline falls through, so a pie's wedges need no hit boxes; with none it takes no input and has no access row, and with input it derives one as a box would (a clickable wedge is a button), so name it. A ninth point and later are dropped with `polygon-points-truncated`; fewer than three draw nothing; no `bg`, no fill. On the wire it is one `fragment` quad painted by a WGSL function the core registers itself, so a host that draws the list gets its source from `kui_fragment_source` like any other; what it costs is that quad and one pipeline switch per run of polygons. A stroked outline is a closed `line` over it. |
| `<path d="M … Z" bg width color fillRule rotate pivot dash dashOffset/>` | `path { d = "M … Z", bg=, width=, color=, fill_rule=, rotate=, pivot=, dash=, dash_offset= }` | `kui_path` | `kui.path`, `kui.path_d` | Any outline — SVG's `d`, a pie wedge with a round arc, a map's region, an icon — filled with `bg` by `fillRule` (`nonzero`, the default, or `evenodd`) and stroked `width` wide in `color` when `width` is given, the stroke over the fill (`docs/adr/0040-a-path-is-a-mask-in-the-atlas.md`). `d` is SVG path data (`M L H V C S Q T A Z`, absolute or relative), parsed by one parser in the core, so every binding draws the same shape; one that does not parse raises `path-malformed` and draws nothing. JSX also takes `d` as a flat number array of op codes and operands, Lua the same as `ops`, and C only that form (`kui_path_parse` turns a string into it). Placed as a `line` is — always a float in its parent's box space (`float="viewport"` for viewport space), sized to its own bounding box two pixels out on each side (half the stroke's width further), so it takes no room in a row or column, held by the parent's clip as a child is and painted in the parent's layer at its place in the tree (backlog F123). `transition` eases the fill and, with `slide`, its position; the stroke's colour does not tween, as a box's border does not. Hit by its outline under the fill rule (`docs/adr/0026-hit-testing-by-shape.md`): with `onClick`, `onDrag`, `onHover` or `hoverable` a press inside hits it and one in its box past the outline falls through, so a pie's wedges need no hit boxes; a stroke with no fill is hit by its stroke as a line is; with input it derives an access row as a box would (a clickable wedge is a button), so name it. On the wire it is one glyph-mask quad per paint, fill and stroke: the outline is rasterized once per shape, scale and quarter-pixel position into the glyph atlas and tinted like a glyph, so a host that draws text draws paths, and nothing is re-rasterized for a colour tween, a hover or a slide. A `d` that changes is rasterized whole, each time, in time linear in the mask's area and the outline's length (backlog C96): the area under a 300-point series over a 360 × 120 plot at scale 2 is about 0.2 ms, under a 1,400-vertex zigzag that crosses every scanline at every step about 6 ms, two thirds of it the bleed's outline. The fill bleeds half a pixel, so two paths sharing an edge meet without the background showing through; a chart that wants separators gaps its own geometry. A mask a quarter of the biggest atlas page or more, or a path whose ops change twice within a few frames, draws from a texture of its own instead (a `texture` quad), and one past 8192 px on a side draws nothing, with `path-too-large`. `rotate` turns the path, in turns clockwise, about `pivot` — a point in the path's own coordinates, the centre of its box without one (`docs/adr/0041-a-mask-turns-about-its-centre.md`): the turn is the quad's and not the mask's, so a path that only turns — a spinner's arc about its circle's centre — is rasterized once and stays in the atlas at every angle. A path with `rotate` or `pivot` is boxed by the square the turn sweeps, its mask centred on the pivot on a whole pixel, and it is hit where it is drawn; C says a turn that passes through 0 with `KUI_TURNED` OR'd into the fill rule (Odin `c.TURNED`), so a spinner keeps that box at 0, where JSX and Lua tell an absent `rotate` from 0 themselves; `rotate` does not tween. `dash` and `dashOffset` cut the stroke into marks and gaps as a `line`'s do (backlog V2) — lengths as seen, round-capped marks, a gap the dots overlap closed — restarting at every subpath as SVG's do; the pattern is part of the stroke's mask, so a dashed stroke costs what a solid one does, a stroke with no fill is still hit along its gaps, and a `dashOffset` that changes every frame is a shape that changes every frame: the path leaves the atlas for a texture of its own while it marches. |
| `<svg data="<svg …>" src="icon.svg" mode fit color/>` | `svg { data=, src=, mode=, fit=, color= }` | `kui_svg` | `kui.svg` | An SVG document drawn in a box (`docs/adr/0063-an-svg-element.md`): `data` is the markup itself, `src` a file read once and again when it changes (one of the two). `mode` is `auto` (the default) — kui paths when every shape is one a `path` draws exactly, crisp at any size and recoloured live, and one image rasterized at the drawn size and scale when it is not (a gradient, a clip, a mask, a filter, an embedded picture, a butt cap) — or `paths` (always, approximating what a path cannot draw, with `svg-approximated`) or `image` (always). `fit` places the picture's viewBox in the box: `contain` (the default: whole, centred), `cover` (filling it, the overflow clipped) or `fill` (stretched). `color` is what `currentColor` paints — the theme's foreground by default — so an icon drawn `stroke="currentColor"` takes the ink of the text beside it, or a token's. With no `width` or `height` the box is the document's own size; one given, the other keeps its aspect; `grow` or a percentage draws at the size the box was laid out at, a frame after it changes. The box is read as an image: `label` names it, `role="none"` makes it decoration (`image-without-label` otherwise). A document that does not parse draws an empty box and raises `svg-malformed`, a `src` that cannot be read `svg-unreadable`. Never reads the network or another file: an `<image>` the document names by path is left out. |
| `<fragment src={id} image={id} params={[…]} animate>` | `fragment { id=, image=, params={…}, animate= }` | `kui_fragment`, `kui_fragment_with` | `kui.fragment`, `kui.fragment_with`; `kui.fragment_open` in an `if` holds children | A box a registered WGSL function paints (`docs/adr/0015-a-fragment-element-and-the-painter-it-is-not.md`): a conic or a moving gradient, rings, noise, shimmer — anything the paint vocabulary has no prop for. An ordinary node otherwise — it lays out, rounds, clips, fades, takes input and holds children, which paint over it — but with **no intrinsic size**, so give it a `width`/`height` or `fill` or it is zero by zero. `src` is a handle from `add_fragment`, which validates the source and warns rather than minting one that cannot compile. `params` is up to sixteen numbers the shader reads as four `vec4<f32>`; more are dropped with a warning. `image` is a registered image the function reads — `kui_sample(uv)` (bilinear) and `kui_sample_nearest(uv)` return its texels at `uv` in `[0,1]²`, and `in.image` is its texel rect, `zw` the size — which is what makes a replaced image a waveform, a heatmap, a 50k-point line or an image effect from one quad (`docs/adr/0025-the-image-is-the-canvas.md`, decision 7); the core binds the atlas or the image's own texture, whichever holds it, and a fragment whose image is not live draws nothing, as one whose `src` is not does. `animate` asks for a frame every frame, which is what a fragment that reads `time` needs and what a still one must not declare. |
| `<cells rows cols cells={Uint32Array} cursorAt={[row, col]} cursorShape cursorColor size family lineHeight/>` | `cells { rows=, cols=, lines={"row text", …}, runs={{row, col, len, fg, bg, flags}, …}, cursor_at={row, col}, cursor_shape=, cursor_color=, size=, family= }` | `kui_cells` | `kui.cells` | A terminal's screen as one node (backlog C20): `rows × cols` cells, each a character, a foreground and background as `0xRRGGBBAA` (0 = no background), and attribute bits — 1 bold, 2 italic, 4 underline, 8 strikethrough, 16 wide (the glyph spans this cell and the next, which the app leaves blank), 32 the underline is a wave (a terminal's undercurl, SGR 4:3) and 64 dotted (SGR 4:4), either implying it — plus, optionally, the underline's own colour (SGR 58), 0 for the foreground (backlog K4). A glyph is shaped once per character and style variant and thereafter placed at `col × cell_w` without shaping, so a screen whose every cell is new each frame costs what a still one costs (~60 µs for 200 × 50). The cell width is `M`'s advance in the style's font snapped to whole pixels, the height its `lineHeight`; a cell is a cell, so ligatures never form. A character the family has no glyph for is asked of a monospaced face before the platform's fallback list, shaped smaller where it is still wider than its cells (two under wide), and drawn in their middle (backlog F120); the private use area's icons are left as they fall. Box drawing and block elements (U+2500–U+259F) and the Powerline separators (U+E0B0–U+E0BF: the arrows, and the Powerline Extra half circles and wedges) are not shaped at all but drawn from the cell box — a font's are its own line box tall, a cell is `lineHeight` tall, and through the font every `│` was a dash with a gap under it (backlog F66) and a rounded cap a fallback font's squiggle (F112) — so a TUI's frames and rounded rows are seamless in any font, and bold does not thicken a light line (the set has its heavy variants). JSX passes the cells as a `Uint32Array` (or number array) of four entries per cell — codepoint, fg, bg, flags — or five, with the underline colour, in row-major order; Lua a string per row in `lines` plus `runs` of `{row, col, len, fg, bg, flags, ul}` over them (a run's fg, bg or ul of 0 keeps the default: the style's colour, no background, the foreground); C a `KuiCell` array with `ul`. `cursorAt` (`cursor_at`) names a cell to paint under its glyph in `cursorColor` as a `block` (default), `bar` or `underline` — its own name, since `cursor` is the pointer shape. `originLine` (`origin_line`) is the absolute line number of row 0: a grid is one screenful of the app's own history, so a row number means a different line after every scroll, and stamping where the screen sits is what lets a selection keep its ends across one (`docs/adr/0017-selection-as-a-scope.md`). Saying nothing is 0, and a selection then holds only while the screen does not move. The node's own rows apply — an `onKey` makes it the terminal's sink, an `onClick` or `onDrag` carries `cell: {row, col}` on its events — and its access row is `terminal`, the rows joined as its value. |
| `<line from={[x,y]} to={[x,y]} width color/>`, `<line points={[[x,y],…]} curve dash={[6, 4]} dashOffset/>` | `line { from={x,y}, to={x,y}, width=, color= }`, `line { points={{x,y},…}, curve=true, dash={6, 4}, dash_offset= }` | `kui_line`, `kui_polyline` | `kui.line`, `kui.polyline` (points, `[][2]f32`) | A round-capped stroke: one segment, a polyline through `points`, or a smooth curve through them with `curve`. Always a float in its parent's box space (`float="viewport"` for viewport space), sized to its own bounding box, so it takes no room in a row or column — but a float for the room alone: in its parent's box space it paints in the parent's layer at its place in the tree, over the siblings declared before it and under those after, as a child does, and opens no layer of its own (backlog F123; a connector meant to sit under two cards is declared before them). A stroke in its parent's box space is held by the parent's clip as a child is, its hit region with it, so it is cut at a scroller's edge with the row it is drawn in; a declared float is held that way only when it declares `clip` with a parent anchor, and a `float="viewport"` stroke escapes, and is a layer of its own (backlog F78, `docs/adr/0010-a-segment-primitive.md` decision 5). `width` is the stroke width (default 1) and `color` the stroke colour; `transition` eases the colour, and with `slide` beside it the stroke's position too — the points ride its box, so a stroke whose ends all move together slides with them, while one whose ends move apart resizes at once (a canvas of floats eases everything or nothing, connectors included). Hit by its shape (`docs/adr/0026-hit-testing-by-shape.md`): with `onClick`, `onDrag`, `onHover` or `hoverable` a press within half the width of any piece hits it — at least 4 px of grab, so a hairline is a target — and a press elsewhere in its bounding box falls through to what is under; with none it takes no input and has no access row, and with input it derives one as a box would (a clickable connector is a button), so name it. What it costs: one quad per segment, and a curve is flattened in the core at one piece per 6 logical px of chord (at most 32 per span) — fixed rather than tolerance-driven so every binding gets the same pieces and the corpus can pin them — so a nine-point curve over ~50 px spans is ~60 quads, and a `quadCount` budget should expect it. `dash` cuts the stroke into marks and gaps (backlog V2): one length (marks and gaps alike), a mark and a gap, or four lengths for a dash-dot, in px **as seen** — every mark is a short stroke with the stroke's round caps, so `dash` 6, 4 is 6 px of ink and 4 px of nothing at any width up to 6 (SVG's `stroke-dasharray` measures the centre line instead, so with round caps its `4 4` at a width of 4 is solid; this pattern is SVG's `mark − width, gap + width`). A mark no longer than the stroke is wide is a dot as wide as the stroke, in the same period, so its gap is that much shorter; where a mark and its gap together come to no more than the width the dots meet and the gap closes — the marks either side of it are one, and a pattern with no gap left, `dash` 2, 2 at a width of 8, draws solid (backlog RG118). The pattern runs along the stroke's whole length, so it keeps its phase round the corners of a polyline and the pieces of a curve, and `dashOffset` starts that far into it — growing it moves the marks towards the first point, a marquee's marching ants; neither tweens. A pattern with no gap, a mark and gap under a physical pixel together, or more than 16384 marks draws solid. A dashed stroke is hit along its whole length, gaps included, and costs a quad per mark per piece the mark lies on. |
| `<titlebar title>` or `<titlebar>…</titlebar>` | `titlebar { title= }` / `titlebar { … }` | `kui_titlebar`, `kui_titlebar_with` | `kui.titlebar`, `kui.titlebar_with` | Adaptive titlebar for custom chrome: drag strip, native-control inset, window buttons. |
| `<menuBar menu={[{ label, items: [{ label, id?, role?, accel?, enabled?, checked?, items? }] }]} onMenu={msg} standardMenus/>` | `menu_bar { menu = { { label=, items= { { label=, id=, role=, accel=, enabled=, checked=, items= } } } }, on_menu = msg, standard_menus = true }` | `kui_menu_bar`, `kui_menu_bar_with`, `kui_menu_bar_standard_menus` | `kui.menu_bar`, `kui.menu_bar_with`, `kui.menu_bar_standard_menus` | The application menu (`docs/adr/0018-a-menu-bar-the-app-declares.md`): `menu` is what it *is*, and where this element sits is where its titles go when they have to be drawn in the window. One call and not two, because declaring the menu and placing the strip are one decision. It draws **nothing** where the platform owns the bar — macOS, where the driver hands the same declaration to the OS — so the frame has still said what the app's menu is and the strip simply is not there; that is the contract `windowButtons` has under native decorations, and it is what makes one view portable. Its rows are the rows a context menu has: the same `role`s the core performs itself (`copy`, `paste`, `selectAll`, `cut`, `lookUp`), the same `id` payload, the same `accel` text, plus `checked` for a setting — and choosing one arrives as the bar's own `onMenu` message with `menu: {role, item}` in it (ADR 0048), the field a context menu's choice carries on its target's `onMenu`; a bar that declares no `onMenu` posts nothing. Declared every frame and diffed: an unchanged menu costs a comparison, and an empty list takes it away. An accelerator kui can parse is rewritten into the platform's spelling, so `"mod+s"` reads as `⌘S` on macOS and `Ctrl+S` elsewhere and binds that key in the platform's own bar. On macOS the first menu is the application menu, which the OS titles with the app's own name whatever the label says — unless the bar declares `standardMenus` (ADR 0052): then the platform's standard menus stay and these go beside them, so adding one menu is declaring that one menu. On macOS that is the application menu the process has, the standard Edit menu, these menus in order, and the standard Window menu with its tiling and full-screen rows; none of these menus is the application menu, a menu titled `Window` is only a menu, and an `accel` binds as any row's does. Where the bar is drawn in the window (Windows, Linux, a core drawing its own) there are no standard menus, and the bar is these menus alone. While a menu is open the bar is the frame's modal scope, so hovering across the titles moves the open menu, a press on the open title closes it, and Escape or a press in the app below closes it and reaches nothing else. |
| `<windowButtons/>` | `window_buttons()` | `kui_window_buttons` | `kui.window_buttons` | Just the min/max/close buttons, for fully custom titlebars. |
| `<tooltip value="hint"/>` / `<tooltip>…</tooltip>` nodes, or the `tooltip="hint"` prop (see composites) | `tooltip("hint")` / `tooltip { … }` nodes, or the prop | `kui_tooltip`, `kui_tooltip_with` | `kui.tooltip`, `kui.tooltip_with` | A float hanging below the parent; the node form always draws, the prop form is hover-gated. |
| `<latencyGraph/>`, `<latencyHud at/>` | `latency_graph()`, `latency_hud { at= }` | `kui_latency_graph`, `kui_latency_hud` | `kui.latency_graph`, `kui.latency_hud` | Per-phase frame timing (windowed drivers fill it; headless shows the chrome empty). |
| `<audio src={id} loop volume paused finish tag/>` | `audio { src=, loop=, volume=, paused=, finish=, tag= }` | `kui_audio` | `kui.audio` | A playback retained by node key: present = playing (once, or looped), gone = stopped; `volume` / `paused` apply live, a changed `src` restarts; a `tag` brings that message back with `sound: {phase: "ended", playback}` in it (ADR 0047). Draws nothing. `finish` changes what *gone* means: the node's removal releases the playback rather than stopping it, so a one-shot plays to its end and the view need not know the asset's length to declare the node for it (a loop still stops on removal — there is no end to reach — and a paused playback released has nothing to finish). Without it, the way to play a sound whole is to hold the node declared until the `tag`'s `ended` message arrives. A released playback is not free: it holds one of the device's 128 voices until its file ends, and the 129th play is refused — reported as a `playback-refused` warning and, for a `tag`, `phase: "refused"` rather than a wait that never returns. In the app's units, voices held = sound length × release rate: a 1.4 s chime released four times a second holds 6 of the 128 at any moment, a 10 s ambience released once a second holds 10, and every playback still declared (a loop included) counts beside them — a `refused` `sound` event is what arriving at 128 sounds like. |

## Events

Events are plain data: `{ origin, window, key, event, payload, instance }`
from `pollEvents()` in Node, `on_event(ev)` in Lua, and
`kui_poll_event` in C. `event` is which event it was; `origin` is which
frontend drew the node (0 = the app, 1+ = an extension) and `window` is
which OS window it happened in — an extension draws into all of them, so
the two are not one field.

An event arrives as the message its handler declared
([ADR 0047](adr/0047-an-event-arrives-as-the-message-its-handler-declared.md)):
the payload is the handler's message as declared, with the event's data in
one field of it named for the event — `onDrag={{kind: "pan"}}` hears
`{kind: "pan", drag: {phase, x, y, dx, dy, parent}}`. A node that declares
no handler for an event hears none of it. Every payload is a
map: a `null` message arrives as the field alone (`{}` for an event with
no data), and one that is not a map — a string, a number, a boolean, a
list — is kept under `tag`, beside the field or alone: `onClick: "save"`
is heard as `{tag: "save"}`.

There are no root events
([ADR 0048](adr/0048-a-window-declares-the-messages-its-events-arrive-as.md)):
what has no node of its own is declared where the app declares the
window. A window's own events — its size, its keyboard, the OS's
settings, the installed fonts, the modifiers, the documents the OS opens
— arrive as the messages of the root's `windowEvents` group
(`onResize`, `onFocus`, `onSystemSettingsChange`, `onFonts`,
`onModifiers`, `onOpen`); a declared window's opening, closing and a
popup's dismissal as its `windows` entry's `onWindow` and
`onDismiss`; a choice from the application menu bar as the `menuBar`
element's `onMenu`. A key nobody declared is an event nobody hears.

| event | handler | field | payload | when |
|---|---|---|---|---|
| click | `onClick` | `click` | the `onClick` message as a map (a non-map one under `tag`); `click: { cell?: { row, col }, line?, byte?, inside?, clicks?, mods?: { shift, ctrl, alt, super }, key?: "enter" \| "space" }` in it where the node can say more | A press and release on the node (suppressed when a drag moved past the slop). A plain click arrives as declared — a map as it is, any other message under `tag`. Where the node can say more the message gains `click`: `cell: {row, col}` on a `cells` grid, and inside an `onKey` sink that draws `role="line"` rows, `line`, `byte`, `inside` and `clicks` as a `drag` inside one carries them. A map message also says what the click was made with (backlog C101's facts): `mods` while a modifier is held (a ⌘-click, a Shift-click), `clicks` from a double click's second click on, and `key` — `enter` or `space` — for a click a key made; a plain click carries none of them. A message that is not a map is kept under `tag` beside it, and gains none of these. |
| drag | `onDrag` | `drag` | `drag: { phase: "start" \| "move" \| "end", x, y, dx, dy, parent: { x, y, w, h } }` in the `onDrag` message | A pointer-captured drag on an `onDrag` node. `x`/`y` are where the pointer is; `dx`/`dy` are its displacement **from the press point**, in every phase — `start` carries zero, a `move` how far the pointer is from where it pressed, `end` the whole distance — so a handler sets `value = start + dx` rather than summing deltas, and can commit from `end` alone. Nothing is dropped under the click slop (3 px, measured from the press): the first `move` already carries the whole distance. `parent` is the container rect, so fractions need no geometry query. On a `cells` grid every phase also carries `cell: {row, col}`. Inside an `onKey` sink that draws `role="line"` rows — an editor the app owns — every phase carries `line` (the ordinal among the sink's lines, the numbering its `select` events use), `byte` (where the point falls in that line's text, what `textHit` would answer) and `clicks` (the press's count), so click-to-caret, drag-select and double-click-word are arithmetic on the event with no query and no frame of lag; a point above the first line is the first, below the last the last, and one in a `role="none"` gutter is the line beside it, and `inside` says whether the point is within that line's own box at all — false above, below and in the margin beside a row, so a margin gesture (block selection) is told from a press on the text without comparing `x` to a rect. Nothing is added where the sink draws no lines. |
| key | `onKey` | `key` | `key: { phase: "down" \| "up", code, physical, shift, ctrl, alt, super, text, repeat, location, caps_lock, num_lock }` in the `onKey` message | A key press or release on the focused `onKey` sink; `code` is a character or a name (`"left"`, `"f5"`) and is what a keymap binds against. `physical` is the US-QWERTY key at that *position*, spelled the same way — bind it instead when you want the finger rather than the label (WASD stays a square on every layout). `code` follows the layout while the layout speaks ASCII, so a chord lands on the key the user can see (Dvorak's `⌥v` on the key printed V); on a layout that does not (Cyrillic, Greek, Hebrew, Arabic) the position's US key stands in, as Shift prints it (`J`, `:`; unshifted under Alt, as a chord reads it), so a Latin keymap keeps matching instead of matching nothing. A shifted letter arrives as the upper-case letter — `Z` with `shift` set for ⇧⌘Z, `physical` staying `z` — so a keymap that binds letters folds a one-character `code` to lower case under a chord; a headless press is spelled the same way, since no door re-spells it (`"z"` with `shift` is a chord no keyboard produces). `repeat` marks a press the OS auto-repeated; `text` is what the press would insert — always the layout's own character — and is null on every release and under a chord, but for a Mac's Option while it composes: ⌥- arrives as `-` with `alt` and `text` `–`, ⌥⇧- with `—`, so an editor of your own types what the platform's do (backlog F195), and an Option `optionAsAlt` names types nothing. A key only comes up where it went down: a release whose press the sink never got is dropped, and focus leaving while a key is held delivers the `up` first, so a held-key binding (WASD, press-and-hold) cannot be left stuck down. `location` says which of a key's twins it was (backlog F108): `"left"` or `"right"` for a modifier, `"numpad"` for the keypad's digits, operators, Enter and (Num Lock off) arrows — `code` still `"1"`, `"enter"` — else `"standard"`; `caps_lock` and `num_lock` what the lock keys held. The keys F13–F35, `printscreen`, `pause`, `menu`, `clear` and the media keys (`mediaplaypause`, `volumeup`, …) are keys like any other; the modifier and lock keys themselves (`shift`, `ctrl`, `alt`, `super`, `capslock`, `numlock`, `scrolllock`) reach only a sink that says `modifierKeys`. |
| text | `onKey` | `text` | `text: { text, pasted?: true, concealed?: true, transient?: true }` in the `onKey` message | Text an IME committed at the end of a composition — or the clipboard's text, when the app asked for a paste with `requestPaste` / `request_paste` / `kui_request_paste` — on the focused `onKey` sink (or the nearest one above the focused control, or the root sink with nothing focused) — the one committed text the platform never reports as a key press carrying `text`, so a custom editor inserts it as it would a key's `text`. Plain typing does not arrive this way: the `key` event already carries what the press would insert, and a sink hearing both would type every character twice. A focused `<edit>` takes the commit itself and reports it as its `change`. Assistive technology replacing a custom editor's selection arrives this way too: text to insert over the selection, as a paste is (ADR 0047). A paste's answer carries `pasted: true` (backlog DX14) — an answer being the host's paste reply, or any commit while a paste is outstanding — so a sink that asked tells the clipboard's text from an IME's commit without keeping its own flag; an IME commit has no `pasted`. It also says what the pasteboard marked it (backlog F84): `concealed: true` for a secret — a password manager's copy, which a view should not show, log or keep — and `transient: true` for text not to keep in a history, after the nspasteboard.org convention (on Windows the clipboard's exclusion formats); a marker that is not set is absent, never false. The runner reads them on macOS and Windows; on Linux, and from a host that answers with a bare commit, a paste arrives unmarked. |
| preedit | `onKey` | `preedit` | `preedit: { text, cursor: [start, end] \| null }` in the `onKey` message | An in-progress IME composition on the focused `onKey` sink: `text` is the uncommitted string to show inline at the caret, `cursor` the byte range inside it the IME's own caret covers (null when it does not say), and an empty `text` means the composition ended without a commit, so what was shown goes away. The OS candidate window is anchored for you: the `line` carrying `caret` says where. A focused `<edit>` draws the composition itself. |
| select | `onKey` | `select` | `select: { anchor: { line, offset }, focus: { line, offset } }` in the `onKey` message | Assistive technology asked a custom editor — a node with an editor role that draws its own `role="line"` rows — to set its selection (ADR 0047): `anchor` and `focus` as line ordinals and byte offsets into those lines' text. It reaches the sink the editor types into, its own `onKey` or the nearest one above it. The app owns the selection, so nothing moves until the view draws it. |
| selectionrange | `onSelectionRange` | `selectionrange` | `selectionrange: { from: { index, byte }, to: { index, byte } }` in the scope's `onSelectionRange` message, or alone | A copy reached rows of a `selectable` virtual list that no frame built (`docs/adr/0017-selection-as-a-scope.md`, tier 3): the core cannot read text it never laid out, so it asks the app for the range — `index` is a row's data index (its `index` prop), `byte` an offset into that row's text, past the row's length for "the whole row" (a Select All over a list that declared `rowCount` ends that way, on its last row) — and the app answers with `answerSelectionRange(text)` / `answer_selection_range` / `kui_answer_selection_range`, which is what reaches the clipboard as a `setClipboard` action. Raised only while a copy is outstanding (`requestCopy()` answered `asked`, or the runner's Cmd/Ctrl-C did); a late answer changes nothing. `examples/rust/features/clipboard.rs` and its Node twin show the round trip. The app asked for the copy, so a scope that declares no `onSelectionRange` still hears it, as the field alone. |
| contextmenu | `onContextMenu` | `contextmenu` | `contextmenu: { x, y }` in the `onContextMenu` message | A secondary-button press on an `onContextMenu` node, on the press rather than the release; `x`/`y` are logical viewport coordinates — where the menu goes. The core opens nothing: the app declares the menu (a `modal` float) and stops declaring it on `dismiss`. |
| menu | `onMenu` | `menu` | `menu: { role, item }` in the `onMenu` message of the node, or of the `menuBar` | A row of the core's own menu was chosen, on the node the menu was about: a `select`'s, or the target `openMenu` / `open_menu` / `kui_open_menu` named, as its `onMenu` message (ADR 0047). `item` is the row's `id`, or its label when it declared none; `role` is the row's standard role or `custom`. Every chosen row posts, the standard ones included: a `cut` or `paste` role is carried out by the core (its clipboard work queued for the host) *and* reported, so an app can hear its editor being cut from and is free to ignore it (`docs/adr/0017-selection-as-a-scope.md`, decision 5). The stock right-click menu, opened for a node that declared no `onMenu`, sends nothing; a choice from the application menu bar arrives as the `menuBar` element's own `onMenu` message (ADR 0048). |
| forceclick | `onForceClick` | `forceclick` | `forceclick: { x, y }` in the `onForceClick` message | A press that deepened past the second stage of a Force Touch trackpad, on an `onForceClick` node, at the logical viewport point it happened at. Routed as a secondary press is — no focus moved, no caret placed, no click — but asked of the topmost node only, and the ordinary click the press is still producing arrives afterwards. Text needs none of this: over an `edit` or a `selectable` scope the core selects the word under it and asks the host for its Look Up panel instead. macOS-only in practice. |
| button | `onButton` | `button` | `button: { phase: "press" \| "move" \| "release", button: "secondary" \| "middle" \| number, x, y, clicks, cell?: { row, col }, line?, byte?, inside? }` in the `onButton` message | A non-primary button on an `onButton` node that claims it (`buttons`), backlog F105: `press` where it went down — with the driver's click count, `clicks`, which the native runner keeps for the primary button alone and so always reports as 1 here — then `move` for every pointer move while it is held and `release` where it came up, both on the same node wherever the pointer went, since the press captured the button. `button` is the button's name, or for one past the middle button its number (`3 + n`, as `kui_input_mouse_button` takes it; Node's `ctx.mouse` takes the three names only); `x`/`y` are logical viewport coordinates. On a `cells` grid each carries `cell: {row, col}`, clamped to the grid, and inside an `onKey` sink that draws `role="line"` rows `line`, `byte` and `inside` as a drag does. A claimed secondary press is this event instead of `contextmenu`; the press moves no focus, caret, selection or scrollbar. |
| scroll | `onScroll` | `scroll` | `scroll: { x, y, dx, dy, lines, mods?: { shift, ctrl, alt, super }, zoom? }` in the `onScroll` message | The wheel over an `onScroll` node, or a drag-select held past a `cells` grid's top or bottom edge: `dx`/`dy` the delta in logical px as the driver reported it (positive `dy` is the wheel rolling up, toward earlier content), `x`/`y` the pointer in logical viewport coordinates, `lines` the whole lines a `cells` grid's `dy` covers — positive is later history, the sign `originLine` grows in, the fraction carried to the next notch — and null on any other node. The core scrolls nothing for it: the app re-declares the grid's `originLine`, or zooms its canvas. From the edge drag it comes once a frame while the pointer is held past the edge, with the lines that frame's step covers, and the selection's absolute lines survive the scroll the app answers with (`docs/adr/0029-a-selection-follows-the-pointer-past-the-edge.md`). A trackpad's pinch comes as one too (backlog F256), with `zoom` the magnification since the last event (positive zooming in), `dx`/`dy` 0 and `lines` null: to the innermost `onScroll` node around the pointer when the pinch began, one that names `scrollMods` passed by, for the whole of the pinch. Only a pinch carries `zoom`. |
| focus | `onFocus` | `focus` | `focus: { phase: "in" \| "out", by: "pointer" \| "keyboard" \| "assistive" \| "program", mods?: { shift, ctrl, alt, super } }` in the `onFocus` message | Keyboard focus entered or left an `onFocus` node's subtree (backlog DX18). `by` is what moved it — a press, a key, a screen reader's request, or the view and the app — so a pane that follows a click into its sink tells that apart from a move the app made itself. A move the keyboard or the pointer made with a modifier held carries `mods` — a Shift+arrow in a list, what a selection extending a range reads. |
| hover | `onHover` | `hover` | `hover: { phase: "enter" \| "leave", by: "pointer" \| "content" }` in the `onHover` message | The pointer entered or left an `onHover` node — also when a new frame moved it under a still cursor. `by` says which (backlog DX20): `pointer` when the pointer moved or left the window, `content` when it stayed and what is under it changed — a list scrolled by the wheel or the keys, a row that grew, a float that opened. A picker whose selection follows the pointer ignores `content`, or the rows sliding under a still pointer as the keys scroll the list drag the selection with them. |
| drop | `onDrop` | `drop` | `drop: { phase: "enter" \| "move" \| "leave" \| "drop", paths: string[], x, y }` in the `onDrop` message | Files dragged in from the OS over an `onDrop` node (`docs/adr/0031-a-drop-zone-is-a-row-and-the-files-are-an-event.md`): `enter` when they come over the zone, `move` while they move over it (never twice for one point), `leave` when they go to another zone, to no zone or out of the window, `drop` when they land — and no `leave` after a `drop`. `paths` are the OS paths as strings; `x`/`y` the pointer in logical viewport coordinates, absent on `leave`. The zone is the topmost one under the pointer by paint order; a node inside it is its, and a node that is no zone is looked past (an overlay shown on `enter` does not end the hover). Nothing is re-resolved when a frame lands: only the driver's next report moves the files, so a zone the view stops declaring hears its `leave` then. |
| files | `requestFiles` | `files` | `files: { paths: string[] }` in the message `requestFiles` was given, on the root | A file dialog's answer (backlog C51): what an Open, Save or folder dialog asked for with `requestFiles` / `request_files` / `kui_request_files` picked — the OS paths, as a `drop` carries them — or no paths when the user cancelled. It arrives as the message the dialog was asked with. It reaches whoever asked: the host, or the extension whose fill asked; one dialog is out at a time. |
| open | `windowEvents.onOpen` | `open` | `open: { paths: string[] }` in the main window's `windowEvents.onOpen` message | The OS asked the app to open documents (backlog F124): the Finder's Open With, a file dropped on the Dock icon, `open -a App file`, a double-click on a document of a type the app's `Info.plist` declares under `CFBundleDocumentTypes`. It arrives as the main window's `windowEvents.onOpen` message (ADR 0048) whether or not anything asked — unlike `files`, which answers an ask — and not at all from a main window that declares none. `paths` are file-system paths as strings; a URL of a scheme the app registers is not one, and is not carried (room is left for a `urls` beside `paths`). The macOS runner sends it at launch — held until the main window has opened, since AppKit hands the documents over before it exists and puts none in the arguments — and while the app runs; a host driving its own window sends it as input (`openDocuments`, `kui_input_open`, `InputEvent::Open`). Windows and Linux pass documents in the process's arguments instead, and nothing sends it there. |
| layout | `onLayout` | `layout` | `layout: { x, y, w, h, parent: { x, y, w, h }, scale }` in the `onLayout` message | The rect layout gave an `onLayout` node (logical px, viewport coords, after scrolling and easing): on its first frame and whenever it changes, never on a frame that left it alone. `scale` is physical px per logical px at the node — `w × scale` by `h × scale` is how many pixels to render for it before `updateImage` (the frame's scale today; where a zoom would compose in). |
| resize | `windowEvents.onResize` | `resize` | `resize: { width, height, scale }` in the `windowEvents.onResize` message | The viewport changed size or DPI (logical px), as the root's `windowEvents.onResize` message (ADR 0048): the window less the devtools' dock while the panel is docked (`docs/adr/0024`), so a dock coming, going or being dragged is a resize too. `KuiWindow.size()` queries the same numbers, before the first frame as well (backlog F43). The first frame establishes the viewport rather than reporting it, so a dock present at launch posts none. |
| window | a `windows` entry's `onWindow`; `windowEvents.onFocus` | `window` | `window: { phase: "opened" \| "closed", id }` in the entry's `onWindow` message; `window: { phase: "focused" \| "blurred" }` in the `windowEvents.onFocus` message | A declared window opened (the diff queued its `Open`) or closed — because nothing declares it any more, or because the user closed it, in which case it stays closed while still declared: stop declaring it, then declare it again to reopen. It arrives as the `onWindow` message of the window's `windows` entry (ADR 0048) — the last one declared, for a window that closed — and `id` is what the window's events carry; the event itself comes from whichever window's frame noticed. `focused` and `blurred` are this window gaining and losing the keyboard, as its root's `windowEvents.onFocus` message (backlog DX18) — `env.focused` changing, as the driver reports it — so an app that saves on blur or re-reads the clipboard on return hears it once instead of diffing `env.focused` every frame. |
| system | `windowEvents.onSystemSettingsChange` | `system` | `system: { appearance, accent, motion, locale, assistive, contrast }` in the `windowEvents.onSystemSettingsChange` message | An OS setting the user changed while the app was open — the light/dark appearance, the accent colour, reduced motion, increased contrast, or the UI language — or assistive technology starting to listen (as the root's `windowEvents.onSystemSettingsChange` message, ADR 0048: one per window that noticed and declared it). The field is `env.system` as it now reads, in the same spellings and with the same nulls, so a handler can keep the whole reading or take the one field it branches on. The first frame establishes the reading rather than reporting it, the way the viewport does; a host whose view is a function the runner calls every frame can equally re-read `env` and ignore this, but a host that retains the tree it was handed (Node, C, Lua) only re-runs its view for a message, so declaring this is how a palette follows the OS. |
| fonts | `windowEvents.onFonts` | — | none: the `windowEvents.onFonts` message as declared | The system's installed fonts changed: a rescan found a face installed or removed since the last one (as the root's `windowEvents.onFonts` message, ADR 0048: one per window that noticed and declared it). The winit runner rescans itself when macOS or Windows says the set changed; elsewhere it is the app calling `reloadSystemFonts`. Re-read `systemFonts()` / `systemFontFamilies()` here if the model holds them; a view naming a family by `family` needs nothing, it resolves on the same frame. A font the app loads itself raises none, and the first frame establishes the set rather than reporting it. |
| modifiers | `windowEvents.onModifiers` | `modifiers` | `modifiers: { shift, ctrl, alt, super }` in the `windowEvents.onModifiers` message | The physical modifier state changed (as the root's `windowEvents.onModifiers` message, ADR 0048). |
| change | `onChange` | `change` | `change: { value, phase: "move" \| "end" }` on a slider, `change: { text }` on an editor, in the `onChange` message | A `slider` that declared `onChange` (the stock `<slider>`, ADR 0034): the core turned a press into the value under the pointer, a drag into each new step, an arrow or assistive technology's increment / decrement into one `valueStep` and its set value into that value snapped, PageUp / PageDown into ten, Home / End into the ends — clamped to `valueMin`..`valueMax` and snapped to the step, the decimal the step names. `phase` is `move` while the pointer holds the slider and `end` when it lets go or a key moved it; a key that lands where the slider is proposes nothing. The value is proposed: declare it as `valueNow`. An editor that declared `onChange` — an `<edit>`, or a custom editor assistive technology set the value of — reports every change to its text as `text`, the whole text after it (ADR 0047). |
| submit | `onSubmit` | `submit` | the `onSubmit` message as a map (a non-map one under `tag`, none as an empty map) | Enter in a single-line editor. |
| cancel | `onCancel` | `cancel` | the `onCancel` message as a map (a non-map one under `tag`, none as an empty map) | Escape let go of a focused editor: the keyboard leaves it, as it does for a click elsewhere, and this says it was Escape — a draft abandoned, where `submit` is one confirmed and a plain blur is neither. A field that commits on blur cancels here instead. |
| boundary | `onBoundary` | `boundary` | `boundary: { key: "up" \| "down" \| "left" \| "right" \| "backspace" \| "delete", edge: "start" \| "end", word, doc, ctrl }` in the `onBoundary` message | An editing key that met the edge of an editor's text and did nothing: ↑ on the first line, ← or Backspace at the start (`edge: "start"`), ↓ on the last line, → or Delete at the end (`"end"`) — from a caret with no selection and without Shift. What a block editor joins blocks and moves between fields by. A field has one line, so its ↑ and ↓ always report. `word` and `doc` are the editing modifiers the key carried (Option or Ctrl, ⌘ or Ctrl — `docs/adr/0002`). |
| sound | `play(id, { tag })`, `<audio tag>` | `sound` | `sound: { phase: "ended" \| "refused", playback }` in the playback's message | A tagged playback (`play(id, { tag })` or `<audio tag>`) finished on its own — never when something stopped it. `phase: "refused"` instead when the device would not take the play at all (its 128 voices are all held, or the sound did not decode): that playback never starts and so never ends, so this is what arrives in place of the `ended` a view would otherwise wait forever for. |
| capture | `captureTo(path, message)`, `recordTo(path, message)` | `capture` | `capture: { phase: "saved" \| "failed", path, width, height, frames, seconds, error? }` in the message the verb named | A still or a recording the app asked the driver for was written to its path, or could not be (ADR 0055). `width` and `height` are physical px; `frames` is 1 for a still and the frames drawn while recording for a recording (one that changed nothing is folded into the one before in the file), `seconds` a recording's length; `error` says why a `failed` one failed — a directory that is not there, no GPU, an extension that names no format. The path's extension is the format: `.png`, `.jpg`, `.webp` or `.gif` for a still, `.png` / `.apng` or `.gif` for a recording. A verb with no message writes the file and is not heard. |
| dismiss | modal; a popup's `windows` entry `onDismiss` | `dismiss` | `dismiss: { reason: "escape" \| "outside" \| "accelerator" }` in the `modal` message on a node; `dismiss: { reason, id }` in a popup's `onDismiss` message | The user asked for a surface to go away — Escape, or a press that landed outside it. The core closes nothing: the app stops declaring the surface (or asks first). A `modal` node gets one on the node, as its `modal` message, and only the modal in effect does; a `kind: "popup"` window gets one as its `windows` entry's `onDismiss` message (ADR 0048), carrying the window's `id`, reported by the driver because a press outside a window and a key sent to a non-activating one are both facts only the OS has. The two are the same event, so a dropdown that graduates from a modal float to a popup window changes its declaration and not its handler. |
| component | a component's event prop (`onSelect`, Lua's `on_select`) | — | the message the host passed for the prop, with the extension's own fields under the prop's field — `select` for `onSelect` — on the instance; their shape is the component's to document | A component instance's event (`docs/adr/0060-components-an-extension-provides.md`): the extension answered an event of its own with `emit(prop, fields)`, and the host hears the message it passed for that prop — its own type, as a stock control's events arrive (ADR 0047) — about the instance's key, to whoever placed the instance. A prop the host did not pass delivers nothing. |
| range | `onRange` | `range` | `range: { first, last }` in the `onRange` message | The data rows in an `onRange` node's view (ADR 0065): the least and greatest data index among its children inside its box, after the frame that first lays it out and whenever either changes — never on a frame that left them alone, so a view that pages by it does not loop. |
| query | `onQuery` | `query` | `query: { matched, width, height }` in the `onQuery` message | A node's matched `when` entries over its own size and the window's (ADR 0069): `matched` the 0-based indices into its `when` list of every entry that matches, `width` and `height` its size — after the frame that first lays it out and whenever that set moves; on a lazy branch's node, its decision (`matched` is `[0]` while `render` is built). State and environment changes have events of their own and do not raise it. Nothing needs it to lay out: the core applies the entries itself, so this is for a view that keeps the fact in its model. |
| typeahead | `onTypeahead` | `typeahead` | `typeahead: { text }` in the `onTypeahead` message | Type-ahead in a `list` or `table` composite that matched none of the rows the frame built (ADR 0070): `text` is the whole search so far, lower-cased. Answer with `answerTypeahead(key, index)` — the core reaches for that row, scrolling to it if it is not built — or not at all. |
| itemkey | `onItemKey` | `itemkey` | `itemkey: { phase, code, physical, shift, ctrl, alt, super, text, repeat, location, caps_lock, num_lock, item, index, column? }` in the `onItemKey` message | A key a composite's focused item did not claim (backlog C120), on the composite: a `key` event's press (`phase` is always `"down"`) with `item` the focused item's key, `index` its data `index` or else its place among the items, and `column` a table cell's column. Presses only, no releases, and never a modifier alone. |

## Resources

| what | Node | Lua | C | Odin |
|---|---|---|---|---|
| image | `ctx.addImage(w, h, rgba)` → id for `<image src>` | the host registers; `image { id }` | `kui_image_add` → `kui_image` | `kui.image_add` → `kui.image` |
| fragment (WGSL) | `ctx.addFragment(src)` → id for `<fragment src>` | the host registers; `fragment { id }` | `kui_fragment_add` → `kui_fragment` | `kui.fragment_add` → `kui.fragment` |
| font from bytes | `ctx.addFont(buffer)` → id for `font` | the host registers; `font = id` | `kui_font_add` → `KuiTextStyle.font` | `kui.font_add` → `Text_Style.font` |
| font file by path | `ctx.loadFontFile("fonts/Antonio.ttf")` → id for `font` | the host registers; `font = id` | `kui_font_load_file` | `kui.font_load_file` |
| a folder of fonts | `ctx.loadFontsDir("fonts")`, then pick by name | the host loads | `kui_font_load_dir` | `kui.font_load_dir` |
| font by family name (installed or loaded) | `ctx.addSystemFont("Antonio")` (see `systemFontFamilies()`) | the host registers; `font = id` | `kui_font_add_system` (see `kui_font_families`) | `kui.font_add_system` (see `kui.font_families`) |
| sound (wav / ogg / mp3 / flac bytes) | `ctx.addSound(buffer)` → id for `<audio src>`, `clickSound`, `play(id)` | the host registers; `audio { src = id }`, `click_sound = id` | `kui_sound_add` → `kui_audio`, `KuiSpec.click_sound`, `kui_play` | `kui.sound_add` → `kui.audio`, `Spec.click_sound`, `kui.play` |

Handles are slotmap keys with a generation: a removed resource's handle is
rejected (an image draws nothing, a font shapes as sans) rather than
aliasing whatever took its slot.

## Warnings

A misconfiguration that fails silently — a grow weight with nothing to
split against, two nodes sharing a key, a button with no name — comes back
as data instead: `{ code, key, message }`, each distinct (code, node) pair
once. Node collects them on `app.warnings` (`ctx.warnings()` headless),
Rust drains `Core::take_warnings`, C drains `kui_take_warnings`, and the
Lua runner prints them. `code` is stable — match on it; the message is for
people. In Node the codes are the `WarningCode` union.

| code | meaning |
|---|---|
| `grow-weight-ignored` | A grow weight other than 1 on the only grow child of its parent (the weight splits space between grow siblings, so alone it changes nothing) or across the parent's main axis (cross-axis grow fills the parent whatever its weight). |
| `transition-auto-key` | The child count of a node changed while one of its children carries a transition under an auto-assigned key. Auto keys are sibling positions, so the children that shifted became new nodes and snapped instead of easing. Give list items a key. |
| `duplicate-key` | Two nodes in one frame share a key: everything retained per key (transitions, scroll offsets, editors, layout events, hover state) is mixed between them. Siblings need distinct keys. |
| `ambiguous-key` | A label resolved by name (`focus("beta")` in Node, `env.set_focus("beta")` in Lua, `kui_key_of` in C) is declared by more than one node in the frame, under different parents, so they have distinct keys and the name picked the first in tree order. Labels are unique among siblings, not across a tree. An extension asking from inside a fill is answered from the nodes that fill opened and no one else's — not even its own other instances' — and the host from its own first; so this is a clash among the asker's own. Give the node meant a label nothing else declares, or pass the hex key an event carried. Two nodes with the *same* key are `duplicate-key`. |
| `ambiguous-name` | A lookup by accessible name (`Core::key_named`, `ctx.keyNamed`, `kui_key_named`) found more than one node with that name in the last frame — two buttons both read as "Delete" — and used the first in tree order. A reader hears the same name twice too: give each a `label` that says which, or look the one meant up by its key label. When one of them is static text and another is not — a caption under the button it repeats — the message says so: a caption a reader need not hear is decorative, and `role="none"` on the box around it takes it out of the tree (backlog F140). |
| `focus-region-without-node` | A `focusRegion(name)` (`Core::focus_region`, `env.focus_region`, `kui_focus_region`) named a node the frame after it did not declare as a `focusRegion` — no node under the label, or a node without the row — so nothing was entered and focus stayed where it was. The call is resolved against the frame it lands on, so an `update` that toggles a dock on and enters it in one go is fine; this is that call with the view half missing, with a name the view spells differently, or naming a node that is not a region. |
| `label-without-node` | A `reveal` or `setScroll` by label (`env.reveal("rows")`, `win.reveal("rows")`, `Core::reveal_label`) named a label the frame it resolved against did not declare, so nothing moved. A label is resolved when the frame finishes, so a view may name a node it is declaring right now, or one the next frame declares; this is the name spelled differently from the `key` that declares it, or the node not declared at all. |
| `unknown-family` | A text's `family` named a family no installed or loaded font has, so it shaped as sans; or a family token's fallback list matched nothing, so a text naming the token shapes as sans and the message names the token (ADR 0049). `sans`, `serif` and `mono` are kui's own; any other name is matched as `addSystemFont` matches it, and `systemFonts()` lists the names a machine has. |
| `nested-selection-scope` | A `selectable` node inside another `selectable` node. Selection scopes do not nest: the innermost one owns every run under it, so the outer scope selects only the text outside the inner one — and a drag that crosses the boundary stops there, which reads as a selection that will not extend. Declare the scope once, on the container whose text should select as one. |
| `image-without-label` | An image with no `label`: assistive technology has nothing to say for it. Decorative images take `role="none"`. |
| `slider-value-out-of-range` | A `slider` (or a `progress` or `meter`, which read the same rows) whose `valueNow` lies outside its own `valueMin` / `valueMax`, or whose `valueMin` is above its `valueMax`. The row is advertised verbatim, so a screen reader reads a value the range says is impossible; the app that clamps in its own `update` keeps the range in two places with nothing tying them, and this is the tie. Declare the range the value is really held to, or clamp where the view declares it. |
| `fragment-rejected` | `Core::add_fragment` was given WGSL that does not compile, so no handle was minted and nothing will draw. The message carries naga's own error with the line numbers moved into the app's source. The source is rejected here rather than at the first frame that shows it, so a headless test sees it too. |
| `fragment-params-truncated` | A `fragment` node declared more than sixteen `params`. The shader takes four `vec4<f32>` and no more, so the extra numbers were dropped; pass fewer, or pack what the fragment needs into the sixteen it has. |
| `polygon-points-truncated` | A `polygon` declared more than eight points: the stock fragment takes eight vertices in the sixteen params it has, so the rest were dropped. Two polygons, or a `path`, which takes any outline. |
| `path-malformed` | A `path`'s `d` did not parse: the message names the byte and what was expected there (a number, a command letter, an arc flag). Or the path holds a number that is not finite - a NaN or an infinity, which `1e99` in `d` is - among its coordinates or in its turn. The node draws nothing. Raised once per key. |
| `path-too-large` | A `path`'s mask is wider or taller than a texture the device can hold, so it draws nothing: the message names the size and the limit. Draw it smaller, or as several paths. |
| `modal-behind-content` | The frame's modal surface is not in a float, and content painted after it is drawn on top of it: everything the user can see over the modal is inert, which looks like inert-behind is broken. A modal that has to cover the app is a float (`float="viewport"`). Also raised for a modal that *is* a float when another float from outside its scope stacks over it: a HUD opened after the dialog is the same inert surface over it. |
| `control-without-name` | A control (a button, link, tab, checkbox, slider, editor) with no computable name: no `label`, and no text inside it. Icon buttons and editors need a `label`. |
| `focusable-inside-item` | A focusable node inside a composite's *item* — a button inside a list row, a link inside a tab. The item is one roving stop of a composite, so the Tab ring stops at the item and nothing reaches what is inside it: declared, and impossible, which is what `modal-behind-content` set the precedent for. A focusable node inside the *container* but outside every item — a "+" at the end of a tab bar — is reachable and is not reported. |
| `control-inside-live` | A control — anything focusable or with a click — inside a `live` region. A live region reads as one message, its subtree presentational (that is what makes every platform announce it), so assistive technology cannot reach the control at all: a notice's Retry, a toast's close button. Put `live` on the node holding the message alone, beside the controls. |
| `item-outside-container` | A `radio` with no `radioGroup` above it, or a `tab` with no `tabList` — the stock `<radio>` included. Outside its container an item is no composite's: each one is a Tab stop of its own, the arrows, Home and End do not move the choice, and a screen reader announces no "2 of 3". Wrap the set in the container, labelled with what the choice is. A `menuItem` or `listItem` on its own is not reported: the menus build their own container, and a row outside a list is only a looser reading. |
| `modal-without-name` | A `modal` surface with no `label`. A dialog is not named by the text inside it (it is not one of ARIA's name-from-content roles), so a screen reader announces it as an unnamed dialog — the same silent defect `control-without-name` catches, on the node that just took the user's focus. Only the derived dialog role is checked: a modal that says what it is with an explicit `role` says it with a `label` too, or means something naming works differently for. |
| `live-region-without-name` | A node declares `live` but carries no `label` and holds no text, so nothing it ever does can be announced: every platform derives the spoken string from a name, and there is none to derive. The same silent defect `image-without-label` catches, on the node that was meant to speak. |
| `announcement-repeated` | The same announcement text was queued on two consecutive frames. That is what an unguarded `announce` in a frame builder looks like — a view runs every frame, so the message is said every frame — and it is never what an app means: a message genuinely repeated is repeated across frames the user did something in between. The announcement still goes through; this names the builder that is shouting. |
| `wrap-ignored` | `wrapChildren` on a container that cannot break lines: a column, a row whose main axis scrolls, or a row of a table, whose children are the table's columns. All lay out exactly as if the flag were absent, which reads as "wrapping is broken"; see `LayoutSpec::wrap` for why a column cannot have it. |
| `align-ignored` | An alignment declared where it means nothing: a spread (`spaceBetween` / `spaceAround` / `spaceEvenly`) on `crossAlign`, `baseline` on `mainAlign` or on a column's `crossAlign`, or either as a float's attach point. Each lays out as `start` — the two centring spreads as `center` — which reads as "the value is broken" when it is the axis that is wrong. |
| `aspect-ignored` | An `aspectRatio` with nothing it can set: both axes are declared, or the width is `fit` under a `grow` or percent height, which is resolved only after every width is. The ratio sizes a fit height from the width, or a fit width from a fixed height. |
| `backdrop-blur-hidden` | A `backdropBlur` under an opaque `bg` of the node's own: the background paints over the whole blur, so nothing of it shows and the copy and the passes are spent for nothing. Give the `bg` some transparency (`#ffffff40`) — frosted glass is a translucent fill over a blur (backlog F129). |
| `reveal-without-anchor` | A `revealOnHover` node with no ancestor that tracks the pointer — no `onClick`, `hoverBg`, `hoverable` or other hit region above it — so nothing's hover can show it, and it is drawn always rather than hidden for good. Put `hoverable` on the row or group whose hover should show it (ADR 0051). |
| `text-beyond-line` | A text node sits more than four levels below the `line` row above it, which is as far as a text's place remembers its ancestors — so `textHit` / `caretRect` asked by that row's key cannot find the run, and a press inside it reports `byte: 0`. Flatten the wrappers between the row and its text, or ask by a nearer key. |
| `exit-budget` | One frame removed more nodes declaring `exit` than the exit store will hold (4096, `depart::MAX_NODES`), so none of that frame's removal animated: every departing node of it vanished at once, as a node with no `exit` does, rather than some sliding out and the rest blinking. Correct, and invisible from the outside, which is the whole reason it is a line here: a list that drops a thousand rows wants `exit` on the list, not on every row. A removal that fits the budget but finds earlier exits still in flight evicts those, oldest first, and is not this warning. |
| `unknown-prop` | A prop name nothing claims: not a schema row, not a composite, not one of the element's own props (see `schema::known_prop`). The binding threw the declaration away — `hoverBg` in a Lua table, `onclick` in JSX — so unlike every other code here this one is raised by the frontend that saw it, through `Core::warn`: by the time a frame is a tree the name is gone. The message names the likely spelling. Also raised for a key a menu row map carried that no row reads — `disabled` on a select's option, where the key is `enabled` — by the binding that read the row. |
| `size-expressions-full` | The process has spelled 65 536 distinct size expressions — the most the table every window shares keeps, and never lets go of — and one more was declared: that prop is left at its default (a `width` is fit, a clamp none) instead of failing the frame, and so is every new expression after it; the ones kept still resolve. A view that makes a new expression per frame reaches it — a `{ max: [dragX, { percent: 30 }] }` fed a splitter's fractional drag, a `format!` of the pointer — where one expression per layout, with the moving part a px size beside it, would not. Raised once per core; the message names the last expression refused. |
| `duplicate-window-config` | One name declared with two different window configs on the frame it opened. The config is read on the opening edge only, and on that edge the lowest declaring window wins (the first declaration within one frame), so the pick is deterministic — but two places in the app disagree about what `"palette"` is, and only one of them is right. |
| `window-declared-while-closed` | A window the user closed is still declared, so it stays closed: a declaration reopens a window only when it *starts*, and this one never stopped. The first version of every multi-window app does this — it declares the window unconditionally — and from outside it looks like `windows` being ignored. Handle the entry's `onWindow` message (its `window: {phase: "closed", id}`), stop declaring the name, and declare it again to reopen. |
| `unknown-window-kind` | A window declared with a `KUI_WINDOW_KIND_*` this build does not have — `KUI_WINDOW_KIND_NORMAL`, `KUI_WINDOW_KIND_POPUP` and `KUI_WINDOW_KIND_SURFACE` are the three there are. Only a C host can reach this: JSX and Lua name a kind by string, so an unknown one is refused where it is written rather than reported a frame later. The window still opens, as a normal one, so a host built against a later header degrades to a window rather than to nothing; this line is what keeps that from being silent. |
| `surface-without-host` | A window declared as a surface — an island a host draws into its own world (`docs/adr/0076-an-island-is-a-window-the-host-draws.md`) — under the windowed runner, which has no world to draw it into: it opens nothing, and the rest of the app runs. A surface is for a host that drives kui itself (a game on its own window and GPU device); under the runner, a float or a normal window is what shows the subtree. |
| `no-system-fonts` | The system has no font the shaper can read — a container with no fonts installed, a minimal Linux image — so every text is drawn in kui's last-resort face, each character a box half an em wide: it measures and lays out, and reads as nothing. Install a font (`fonts-dejavu-core` on Debian and Ubuntu), or register one with `add_font` / `load_fonts_dir` and name its family. |
| `edit-text-without-editor` | A `setEditText` (`Core::set_edit_text`, `kui_edit_set_text`) named a key or a label, the text was held for the frame that would declare it, and the frame after the call declared no editor under that name — so nothing was ever seeded and the text is dropped. The call is meant to run from an `update` that also opens the editor, one frame ahead of the view that declares it; this is the same call with the view half missing, or with a name the view spells differently. Pass the label the editor's `key` prop declares — the spelling that needs nothing to exist yet — or the hex key an event carried. `keyOf`/`kui_key_of` turns a label into that key, but only for an editor some frame declared (Lua's verbs take the label itself). An editor that already exists takes the text where the call is made and never reaches this. |
| `slider-without-handler` | The keyboard or assistive technology asked a `slider` that declares no `onChange` to move. A slider proposes its value in the `onChange` message and moves when the view declares it back as `valueNow`; without the row there is no message to propose it in, so the slider stays where it is (ADR 0047, decision 5). |
| `edit-value-without-handler` | An editor declares a `value` and no `onChange`. The value always wins, so every keystroke is undone on the next frame and the field looks frozen: declare `onChange` and store the `change`'s text in the model the value is read from (ADR 0047, decision 8). |
| `cells-too-large` | A `cells` grid declared more cells than one grid takes — `cells::MAX_CELLS`, 4,194,304, a 2048 x 2048 screen — so it draws the rows that fit and no more: `rows * cols` from a driver's arithmetic (a `u32` each in C) overflowed or asked for gigabytes. |
| `message-field-taken` | A handler's message has a field named for the event it arrives as — `{kind: "k", key: "a"}` declared as an `onKey` message — and the event's data replaced it, so the app's own value never reaches it (ADR 0047, decision 4). Rename the field: the event's name is the core's in a message that event arrives as. |
| `window-events-off-root` | A node other than the root declares `windowEvents`. The group is the window's, read on its root alone, so this one is ignored and its events arrive as nothing (ADR 0048): move it to the root. |
| `edit-value-and-initial` | An editor declares both `initial` and `value`. The value wins, and the seed is never read (ADR 0047, decision 8). Raised by the bindings whose editor takes the two as separate props. |
| `truncated-playback` | A one-shot `audio` node went away — or changed its `src` — while the sound it started was still playing, so the user heard it cut off. Almost always a duration guessed short: the view keeps the node declared for a constant it picked, and the asset is longer. Ask for the sound instead of the guess — `finish` (`AudioSpec::finish`, `finish` in JSX and Lua) releases the playback on removal so it plays itself out, and a `tag` arrives with `sound: {phase: "ended"}` in it when it gets there. A view that means to cut the sound off says so by stopping what it started (`Core::stop`), which is not reported, and a `looped` playback never is: it has no end to be short of. Only a driver with a real device raises it, because only a device knows the sound was still running: the core queues the `stop` and the driver answers `Core::audio_truncated` for the ones its handle found still playing. A headless `Ctx` therefore never raises it — nothing plays — and the assertion point there is the other end of the same fact: `audioCommands()` holding a `stop` for the node, where the suite expected none. |
| `foreign-resource` | A `FontId` / `ImageId` / `SoundId` registered in one `Session` and used through a core of another. Handles are unique to the process, so it cannot resolve to somebody else's resource; it behaves as a removed handle does (draws nothing, shapes as sans-serif, plays nothing), which from outside looks like the resource never registered. Two `Core::new()`s are two sessions; windows that share resources are built with `Core::new_in` against one `Session`. |
| `unknown-token` | A colour, length or family prop named a token — `bg = "$peach"` — that nothing declared and that is no theme, metrics or number role, or named one of another kind (a length in a colour slot). The slot is left at the row's default, as if the prop had not been written — no `bg`, a fit width, the theme's foreground for a text's `color` — never an explicit transparent or zero, which would hide the node a typo was on; the same in every binding and in every place a `$name` can go, a keyframe stop and an entrance included, and what `ui.token_color` / `token_length` / `token_family` answer `None` for in Rust. Raised by the binding that lowered the reference, through `Core::warn_unknown_token`, once per name, since the name is gone by the time the frame is a tree. Also raised at the declaration for a derived token whose source — the `from`, or the colour a `mix` or `readable` names — is no colour token declared before it and no theme role: that token is dropped, the message names both, and the rest of the table lands. |
| `reserved-token` | A declared token took a theme, metrics or number role's name (`surface`, `radius`, `disabledOpacity`) under either spelling, or a family token took a stock family's (`sans`, `serif`, `mono`), and was dropped: the roles are the corpus's contract and `$surface` always means the theme's, so an app cannot shadow one. Rename the token. |
| `dtcg-skipped` | A token in a DTCG file (ADR 0062) was skipped or changed on its way into the table: a type kui has no kind for (a shadow, a typography, a font weight), a colour clamped into sRGB, an alias to nothing, two paths that make one name. The message names the token's DTCG path; the rest of the file landed. |
| `unknown-component` | A host placed a component (ADR 0060) that no loaded extension provides: no extension under its namespace, or one that does not list the name in its `components`. Nothing is drawn where it was placed. Raised once per name and key. |
| `children-misplaced` | A fill asked for its host's children (`children()`) where they cannot be: outside a fill, in one placed with none (an extension's root, a devtools tab), or a second time for one group. Nothing is built. |
| `svg-malformed` | An `svg` element's document did not parse (ADR 0063): the message carries the parser's reason. The element draws an empty box of the size its spec gives. Raised once per key. |
| `svg-unreadable` | An `svg` element's `src` file could not be read: the message names the path and the reason. The element draws an empty box, and draws the picture once the file can be read. Raised once per key. |
| `svg-approximated` | An `svg` element forced to `mode="paths"` holds what a kui path cannot draw exactly — a gradient, a clip, a mask, a filter, a butt cap — so it was approximated or left out; the message lists what. `auto` would have drawn it as an image. |
| `svg-too-large` | An `svg` element drawn as an image holds a shape that reaches past 30,000 px at its drawn size — a coordinate like `8e8` — which the rasterizer cannot hold, so the image draws nothing. Raised once per key. |
| `unbalanced-extension` | An extension returned from `view` with nodes still open. The core closed them at the depth the fill began, so the host's tree is what the host declared; outside the guard, the rest of the host's view would have landed inside the extension's last open node. The extension has an `open` without its `close`. |
| `unclosed-node` | The view returned with nodes still open: an `open` without its `close` — in Odin, a bare `kui.box(ui, spec)` where `if kui.box(ui, spec) { }` was meant. Layout closes them, but every node declared after the forgotten close, the core's own menu and devtools panel included, landed inside the open one. Raised once per innermost open node. |
| `layout-of-without-handler` | `layout_of` was asked for a node that declares no `on_layout`, and answered nothing: it keeps the rects of those nodes alone. Declare `on_layout` on it, or read every node's rect from the inspection snapshot (`set_inspect` and `nodes`). Raised once per key. |
| `extension-view-error` | An extension's `view` returned an error. The message is drawn in red where the fill would have been, and reported here once per extension and component rather than once per frame. |
| `recursive-component` | An extension placed one of its *own* components while it was drawing, with no spare handle to draw it (`Extension::reentry`), so drawing it would have meant calling the extension inside itself. The instance is left empty. An extension may host extensions (`Fill::add`) and place theirs — what it cannot do is be its own guest. |
| `perf-names-exhausted` | `request_frame_for` was given more distinct names than a session keeps (256): the rest are recorded as `request_frame`. A name per call — a counter, an id — rather than per reason is the usual cause. Raised once (ADR 0058, decision 8). |
| `perf-trace-failed` | `KUI_PERF_TRACE` (or `perf_trace_to`) named a file that could not be created: nothing is recorded to it. The message names the path and the OS's reason (ADR 0058, decision 11). |
| `playback-refused` | The device refused a play: its voices are all held, or the sound did not decode. A released playback (`finish`) holds one of the device's 128 voices until its file ends, so a view that releases faster than its sounds finish reaches the limit and the 129th play is refused. The refusal is not left silent because the playback never starts and so never ends: a `tag`ged node waiting for `ended` would wait forever. It gets its message with `sound: {phase: "refused"}` in it instead, and this line says why. Stop what the view no longer needs rather than releasing it, or release shorter sounds. |
| `duplicate-tab` | A devtools tab name declared twice in one frame: two `devtools_tab` / `devtools_tab_with` calls, a host form and an extension form of one name, or an extension declaring from its fill under a name the host took. The first declaration stands and the second is ignored; give the second tab its own name. |
| `bad-devtools-tab` | A `devtoolsTab` declaration a binding could not read as either form: a child that is not a function, both a `component` and a child, or a `view` that is not a function in Lua. The tab was not declared. A tab names a component an extension provides, or carries a function the binding calls only when the tab is shown. |
| `select-current-ignored` | A select's `current` names no option the field can show: an index past its options, or a separator's. The field is drawn as if none were in force — an empty description, no row checked — rather than blank with a check on a divider; the options are drawn as declared. A `current` the view computes from a list it also filters is how this happens; the index is into the options as passed, separators counted. Raised once per field. |
| `rule-prop-refused` | A `when` entry names a prop it may not set (ADR 0069, decision 7): an entry over the node's own size sets the layout of its children only — direction, gaps, padding, wrap, alignment, `minColumn` and which children are `hidden` — and no entry sets a handler, an access prop, a key or its children. The prop is left out and the rest of the entry applies. Also raised for an entry past the sixty-fourth, which is dropped. |
| `query-on-fit` | A node reads its own size in an axis whose size comes from its content — a `fit` width under a `when` entry over `width`, or the parent of a lazy branch that needs width — which would loop (ADR 0069, decision 8). The `fit` is refused: the node takes the room its parent offers in that axis, as a `grow` would, and the condition reads that. |
| `query-state` | A lazy branch's `query` names a state condition (`hovered`, `pressed`, `focused`, ...): a hover must not build or drop a subtree. The state conditions are left out of the query; a `when` entry is how a node looks different while hovered. |
| `query-unsettled` | A lazy branch's decision disagreed with the layout twice in one frame: the view was run again once on the first disagreement, as the core does, and the branch it built still did not fit what that layout gave it — a branch whose room depends on itself. The frame is drawn as it was laid out and the next frame decides again. |
| `paint-escape` | With the paint audit on (`Core::set_paint_audit`, `KUI_PAINT_AUDIT=1` for a kui-native driver), a node drew a quad, a glyph or a mask outside the clip of the nearest box above it that clips or scrolls (ADR 0074): what the rule forbids, raised once per node. A node that means to leave declares it — a viewport float, or `escape` on a float anchored to its parent (a menu, a popover, a tooltip) — and is not audited past the box it leaves. A test aid, off unless asked for. |
## Env

The host facts a view reads: `ui.env()` in Rust, `view(env)` in Lua,
`ctx.env()` / `win.env()` in Node. C is the host, so it *writes* them
(`kui_env_set`, `kui_env_set_system`, `kui_env_set_window`,
`kui_env_set_audio`, `kui_env_set_assistive`) and has no
reading; its column names the argument, and so does Odin's, whose setters
are C's. A real window's runner refreshes every fact each frame;
headless, `ctx.setEnv` in Node and the C setters are the writers, and
the conformance corpus drives its two chrome scenes through them. The
`from` column says which Rust struct holds the fact, or that it is derived
or the frame's rather than `Env`'s. Two divergences are deliberate:
`native_controls` is the `Rect` the core holds in Node and a width and
height at the window origin in Lua and C (the shape C's two numbers can
express, and where the macOS traffic lights sit), and `frame_budget_ms` is
derived from `refresh_hz` but part of the reading everywhere, so no view
restates the 120 Hz fallback.

The `system.*` rows are what the *user* set, and every one of them can
also be unknown — which is the default, and what a driver reports for a
fact its platform gives it no way to ask. The Rust runner asks the OS for
all four on macOS and Windows (the appearance through winit, the accent,
motion and locale through AppKit / Win32) and re-asks when the app takes
focus back or the theme changes; on X11 and Wayland it answers the locale
from `LANG` and leaves the rest unknown. Every other driver owns its own
window, so it pushes what it knows through its env setter.
Unknown is a reading, not a missing value: the enums
spell it `"unknown"` and always have a key, the two values are `null` in
Node and an absent key in Lua, and C reads zero as it does everywhere
else. The core acts on two of them in one way — `appearance` and
`accent` derive the theme below, so the stock widgets follow the OS — and
on nothing else: a dark appearance repaints none of the app's own colours
and a reduced motion shortens nothing, because only the view knows which
of its colours is the background and which of its animations carries
meaning. The fifth row, `system.assistive`, is not a setting but a fact
of the same shape: whether an accessibility client has asked for the tree,
written by the runner's bridge rather than by a settings query, and the
one reading that changes what a view *says* rather than what it draws.

| field | from | Node | Lua | C | Odin | description |
|---|---|---|---|---|---|---|
| `refresh_hz` | `Env::refresh_hz` | `refreshHz` | `refresh_hz` | `kui_env_set(refresh_hz)` | `kui.env_set(refresh_hz)` | Display refresh rate in Hz. "The host cannot tell" is `null` in Node (a stable shape to destructure, typed `number \| null`), an absent key in Lua, and a rate at or below zero in C. |
| `frame_budget_ms` | `Env::frame_budget_ms()`, derived | `frameBudgetMs` | `frame_budget_ms` | — | — | One vsync interval at `refresh_hz`, or at 120 Hz when the host cannot tell: the per-frame time budget, and what the latency HUD draws its line at. Derived, and in the reading anyway, so no view restates the fallback. A C host is the one that knows the rate and computes its own. |
| `focused` | `Env::focused` | `focused` | `focused` | `kui_env_set(focused)` | `kui.env_set(focused)` | Whether the *window* has the keyboard at all. Not the focused node — that is the `focus` row. |
| `system.appearance` | `SystemEnv::appearance` | `system.appearance` | `system.appearance` | `kui_env_set_system(appearance)` | `kui.env_set_system(appearance)` | The OS light/dark setting: `"light"`, `"dark"`, or `"unknown"` when the host has no way to ask (`KUI_APPEARANCE_*` in C, where unknown is 0). Unknown is a real answer and the default — a view picks its own palette for it rather than being handed a guess. The core acts on it in one way: the theme is derived from it (ADR 0019), so the stock widgets and a `<text>` with no colour follow the setting — and nothing of the app's own repaints, because only the view knows which of its colours is the background. |
| `system.accent` | `SystemEnv::accent` | `system.accent` | `system.accent` | `kui_env_set_system(accent)` | `kui.env_set_system(accent)` | The OS accent/highlight colour as `0xRRGGBBAA`, ready to pass straight back as a `bg` or `color`. "The host cannot tell" is `null` in Node, an absent key in Lua, and 0 in C — a fully transparent accent is not a colour anyone was given, the way a refresh rate of zero is not a rate. Node's `setEnv` also takes the `"#rrggbb"` spelling a prop takes. |
| `system.motion` | `SystemEnv::motion` | `system.motion` | `system.motion` | `kui_env_set_system(motion)` | `kui.env_set_system(motion)` | The OS reduce-motion setting: `"reduced"` when the user asked for less animation, `"full"` when they did not, `"unknown"` when nobody asked the OS (`KUI_MOTION_*` in C, unknown 0). Spelled as what the user wants rather than as a `reduceMotion` boolean, because the third reading has no place in a boolean. Nothing a view declared is shortened for it — a view that honours it does so where it declares one; the one animation the core starts on its own, a wheel notch's glide (ADR 0050), jumps instead. |
| `system.locale` | `SystemEnv::locale` | `system.locale` | `system.locale` | `kui_env_set_system(locale)` | `kui.env_set_system(locale)` | The UI language as a BCP-47 tag (`"en"`, `"en-US"`, `"zh-Hant-HK"`), for whatever the view formats dates and numbers with; kui does not parse it. Carried inline (31 ASCII bytes, `Locale`) so the reading stays `Copy`, and anything that does not fit reads back as unknown: `null` in Node, an absent key in Lua, an empty `KuiStr` in C. |
| `system.assistive` | `SystemEnv::assistive` | `system.assistive` | `system.assistive` | `kui_env_set_assistive(assistive)` | `kui.env_set_assistive(assistive)` | Whether assistive technology is listening: `"listening"` once an accessibility client has asked this window for its tree, `"none"` while the bridge is up and nobody has, `"unknown"` where there is no bridge — a headless `Ctx`, a runner built without `accesskit`, a C host that never called the setter (`KUI_ASSISTIVE_*`, unknown 0). The reading that changes what a view *says* rather than what it draws: an alert that announces when something is listening and blinks when nothing is. Reported through the `system` event when it changes, like the other four. Two limits are the platform's, not kui's. *Any* client counts — a probe, an accessibility inspector, a test driving the AX API and VoiceOver alike all ask for the tree, and nothing tells them apart — so it says something is listening, not that a person is. And it falls back to `"none"` only where the adapter reports deactivation, which in the pinned AccessKit is AT-SPI alone (the session's accessibility bus going away); on macOS and Windows nothing reports a client leaving, so once it has risen it stays `"listening"` for the window's life. |
| `system.contrast` | `SystemEnv::contrast` | `system.contrast` | `system.contrast` | `kui_env_set_contrast(contrast)` | `kui.env_set_contrast(contrast)` | Whether the user asked for more contrast (ADR 0069): `"more"` under macOS's Increase Contrast or a Windows high contrast theme, `"normal"` when the OS says not, `"unknown"` where nobody asked (`KUI_CONTRAST_*`, unknown 0). What a `when` entry's `contrast = "more"` reads, so a view that thickens its borders for it declares the entry and is not re-run. Reported through the `system` event when it changes, like the rest of `system`. |
| `window.id` | `WindowEnv::id` | `window.id` | `window.id` | `kui_env_set_window(window)`, read back by `kui_ctx_window` | `kui.env_set_window(window)`, read back by `kui.ctx_window` | Which window this frame draws, assigned by the driver: 0 for the window the app starts in. Every event from it carries the same number. |
| `window.custom_chrome` | `WindowEnv::custom_chrome` | `window.customChrome` | `window.custom_chrome` | `kui_env_set_window(custom_chrome)` | `kui.env_set_window(custom_chrome)` | The host asked the app to draw its own chrome, so there is no native titlebar to sit under. `<titlebar>` and `<windowButtons>` build nothing when this is false. |
| `window.maximized` | `WindowEnv::maximized` | `window.maximized` | `window.maximized` | `kui_env_set_window(maximized)` | `kui.env_set_window(maximized)` | The window is maximized — what picks the restore glyph over the maximize one. |
| `window.fullscreen` | `WindowEnv::fullscreen` | `window.fullscreen` | `window.fullscreen` | `kui_env_set_window(fullscreen)` | `kui.env_set_window(fullscreen)` | The window is fullscreen. |
| `window.always_on_top` | `WindowEnv::always_on_top` | `window.alwaysOnTop` | `window.always_on_top` | `kui_env_set_always_on_top(always_on_top)` | `kui.env_set_always_on_top(always_on_top)` | The window is above every other app's: the level the driver set after the frame asked for it (`alwaysOnTop` / `always_on_top` / `kui_set_always_on_top`, backlog C30), on a platform that has one. On Wayland winit has no call for it, so a driver there reports false however often the app asks — which is why a pin button draws its state from this and not from the app's own flag. It is the driver's record of what it set and not a query (winit has no level getter), so a level the OS dropped afterwards — a fullscreen space, a tiling manager — is not seen here. A C host reports it through its own setter rather than an argument on `kui_env_set_window`, the way `kui_env_set_assistive` is, so an older host that never applies a level has nothing to recompile. |
| `window.native_controls` | `WindowEnv::native_controls` | `window.nativeControls` | `window.controls_w` / `window.controls_h` | `kui_env_set_window(controls_w, controls_h)` | `kui.env_set_window(controls_w, controls_h)` | Area (logical px, window coordinates) covered by controls the OS still draws over our content — the macOS traffic lights under custom chrome. Keep out of it. Node hands back the `Rect` the core holds (`{x, y, w, h}`, or `null` for none); Lua and C flatten it to a width and height anchored at the window origin (absent in Lua, `0` in C, for none), which is the shape C's two numbers can express and where the one real instance sits. |
| `window.backdrop` | `WindowEnv::backdrop` | `window.backdrop` | `window.backdrop` | `kui_env_set_backdrop(backdrop)`; read back with `kui_ctx_backdrop()` | `kui.env_set_backdrop(backdrop)`; read back with `kui.ctx_backdrop()` | What is behind the window's transparent pixels, as the driver got it (backlog F126): `"opaque"` (the default, and every headless core's), `"transparent"` (the desktop as it is), `"blur"` (a live blur of what is behind the window) or `"tinted"` (the desktop's colour, not live) — `KUI_BACKDROP_*` in C, opaque 0. The app asks with `Launcher::backdrop` and decides which regions show it by painting them with alpha; this is the answer, which is less where the platform has less — a blur asked of GNOME reads `"tinted"`, the wallpaper kui draws itself, or `"opaque"` where none could be read — so a view paints its translucent regions opaque when this says so. A C host reports it through its own setter, as `always_on_top` is; a C app asks with `KuiRunConfig.backdrop` and its view reads the answer with `kui_ctx_backdrop`. |
| `audio.device` | `AudioEnv::device` | `audio.device` | `audio.device` | `kui_env_set_audio(device)` | `kui.env_set_audio(device)` | What the driver's output device is doing: `"closed"` (the default, and a headless driver's answer), `"opening"` (the ~90 ms open, on its own thread), `"open"`, or `"failed"` (it refused, and commands are dropped) — `KUI_AUDIO_DEVICE_*` in C, closed 0. A fact and not a verb: nothing lets a view close it, the driver does that itself once it has been idle a while. Worth reading because an open stream is a real-time thread whether or not anything plays, which is the whole of an idle app's CPU once a session has held a sound. |
| `audio.live` | `AudioEnv::live` | `audio.live` | `audio.live` | `kui_env_set_audio(live)` | `kui.env_set_audio(live)` | Playbacks started and not yet ended, plus any waiting on the device to open. Zero with the device still `"open"` is the idle stream the row above is about. A play that arrives while the device is `"opening"` counts here from the frame it was asked, until the open answers: if the device refuses, the play is refused on the next apply — its message with `sound: {phase: "refused"}` for a tagged one — and leaves the count with it, so what a machine with no output device shows is `opening`/1 then `failed`/0 with the refusal between (backlog F63). |
| `viewport.w` | `Core::viewport()`, the frame's | `viewport.width` | `viewport_w` | `kui_frame_begin(w)` | `kui.frame_begin(w)` | The logical width of the current (or last) frame's viewport — the window less the devtools' dock while the panel is docked (`docs/adr/0024`), the same number a `resize` reports and Node's `KuiWindow.size()` answers — the other host fact a view wants at the same moment, so it rides in the same reading. Zero before the first frame, since the frame establishes it (backlog F43: this row once read the window instead, so an app under `KUI_DEVTOOLS` sized itself to a viewport it did not have). Node's `viewport` is the `WindowSize` shape `runWindowed` already uses. |
| `viewport.h` | `Core::viewport()`, the frame's | `viewport.height` | `viewport_h` | `kui_frame_begin(h)` | `kui.frame_begin(h)` | Its logical height. |
| `scale` | `Core::scale()`, the frame's | `viewport.scale` | `scale` | `kui_frame_begin(scale)` | `kui.frame_begin(scale)` | Device pixels per logical px: the display scale factor of the window being built, 2 on a Retina display, 1.5 on a Windows display at 150%. A script still lays out in logical px; what it reads this for is landing an edge on a whole *physical* pixel (`math.floor(x * scale + 0.5) / scale`) — a seam between shapes drawn side by side vanishes only there, which a whole logical px is at integer scales alone (backlog C127). Lua's `env.scale`, Node's `env().viewport.scale`; a C or Odin host is the one that knows it and hands it to `kui_frame_begin`. |
| `focus` | `Core::focus()`, the frame's | — | `focus` | `kui_focused()` | `kui.focused()` | The focused *node*'s key, as events carry it (absent for none). A value the host wrote before the view ran, so it lags a same-frame verb by one frame; `env.is_focused(key)` is the live query. Node spells it as the call `focused()` on the context, and C as `kui_focused`, rather than a key on `env`. |
| `focus_visible` | `Core::focus_visible()`, the frame's | — | `focus_visible` | `kui_focus_visible()` | `kui.focus_visible()` | Whether focus shows — the keyboard or assistive technology put it where it is, or acted on it there; a click alone does not. Node: `focusVisible()` on the context. |
| `caret_visible` | `Core::caret_visible()`, the frame's | — | `caret_visible` | `kui_caret_visible()` | `kui.caret_visible()` | The caret's blink phase — `true` draws it (backlog C35). The driver's clock sets it while there is a caret to blink: a focused `edit`'s, or the `caret` a `line` under a focused `onKey` sink declares; a custom editor draws its caret node on the on phase and skips it on the off, keeping the `caret` row on its `line` either way, so it blinks in step with the stock editor and, in a window without the keyboard, not at all. Always `true` headless. Node: `caretVisible()` on the context (`setCaretVisible` is the driver's half, for a test that drives the phase). |
| `now` | `Core::now()`, the frame's | — | `now` | `kui_now()` | `kui.now()` | The frame clock in seconds (backlog F134): the driver's monotonic clock, any origin, the one `transition` and `keyframes` read this frame — 0 before a driver sets one. Read a deadline off it (a toast's expiry, a sequence's beats) rather than off a clock of the app's own, so a test that moves the frame clock moves both. Node: `now()` on the context. |
| `region` | `Core::region()`, the frame's | — | `region` | `kui_region()` | `kui.region()` | The focus region in effect — the key of the `focusRegion` node whose ring Tab walks (absent for the main ring; `docs/adr/0022-focus-regions.md`). What a chord that toggles between a dock and the app reads to know which way it is going. Node spells it as the call `region()` on the context, and C as `kui_region`. |
| `tab_moves_focus` | `Core::tab_moves_focus()`, the frame's | — | `tab_moves_focus` | `kui_tab_moves_focus()` | `kui.tab_moves_focus()` | The window's "Tab moves focus" toggle (backlog C99): while it is on, a multiline `edit` whose Tab would type indentation walks the focus ring instead, as one declared `tabMovesFocus` does. Ctrl+M flips it in such an editor (Ctrl+Shift+M on macOS, as Monaco binds it); what an app reads to show a status label. Node: `tabMovesFocus()` on the context. |
| `platform` | `Core::platform()`, derived | `platform` | `platform` | `kui_platform()` | `kui.platform()` | The platform the app runs on (backlog C116): `"macos"`, `"windows"`, `"linux"` or `"other"` — `KUI_PLATFORM_*` in C, where 0 is a bad context. The same fact a `when` entry's `platform` condition reads, so a script that follows a platform's convention in Lua (a select stepping on a bare arrow off macOS) and a rule that follows it in a `when` always agree. Supplied by the host, or `other` for a portable core. The core can be pinned to another convention with `Core::set_platform`. |

## Theme

The colours a view paints with, as roles rather than values, derived from
the two `system` facts above: the appearance picks the base and the accent
recolours it ([ADR 0019](adr/0019-a-theme-derived-from-appearance-and-accent.md)).
This is the half `system.appearance` was missing — the core still acts on
nothing, but a view that wants to act now has something to act *with*, and
the stock widgets do, so a button, a context menu, a tooltip, a field, a
scrollbar, a focus ring and a `<text>` with no `color` all follow the OS
without an app writing a line.

Read it as `ui.theme()` in Rust, `env.theme` in Lua, `ctx.theme()` /
`win.theme()` in Node and `kui_theme` in C — one `0xRRGGBBAA` number per
role under the name below, so a role goes straight into a `bg` or `color`
prop. Three sources, and the default follows the OS for both facts: pin an
accent of the app's own and keep the OS's light/dark
(`Core::set_accent`, `ctx.setAccent`, `kui_theme_set_accent`), or pin a
whole palette that follows nothing (`Core::set_theme`, `ctx.setTheme`,
`kui_theme_set`). A Lua script reads but does not set: it is a guest in
someone else's frame, and the palette is the host's.

An unknown appearance takes the **dark** base — not a guess about the
user, but exactly what kui painted before this table existed, which is
what makes following the OS safe as the default rather than an opt-in.
Beside the roles ride `appearance` (which base this came from) and
`disabled_opacity` / `disabledOpacity` (a multiplier, not a colour,
which any number prop takes as `$disabledOpacity`, ADR 0049).

| role | Node | dark | light | description |
|---|---|---|---|---|
| `bg` | `bg` | `#14161eff` | `#f6f7f9ff` | The window behind everything. |
| `surface` | `surface` | `#1a1d27ff` | `#ffffffff` | A card, panel or list sitting on `bg`. |
| `raised` | `raised` | `#242733ff` | `#ffffffff` | A surface floating above content: a menu, a tooltip, a popover. Under a light theme it is no lighter than `surface` — a float on a white page separates by its border. |
| `sunken` | `sunken` | `#0e1016ff` | `#eceef2ff` | A well cut into a surface: a text field, a code block, a track. |
| `border` | `border` | `#2a2d3aff` | `#dde1e8ff` | The hairline between two surfaces. |
| `border_strong` | `borderStrong` | `#3a3e4eff` | `#b4bbc8ff` | A border that has to be seen — a float's edge, a focused field. |
| `fg` | `fg` | `#e8e8eaff` | `#1b1e27ff` | Body text, and what a `color`-less text run resolves to. |
| `muted` | `muted` | `#8a8fa3ff` | `#5b6171ff` | Secondary text: captions, hints, an accelerator beside a label. |
| `faint` | `faint` | `#6e758aff` | `#767d8dff` | Text that is barely there: a placeholder, a gutter number. |
| `accent` | `accent` | `#3b5bd4ff` | `#3b5bd4ff` | The one saturated colour: the OS accent where the host reports one, the app's where it pinned one, kui's blue otherwise. The `accent` prop paints from this. |
| `accent_hover` | `accentHover` | `#476ce0ff` | `#4d6ad8ff` | `accent` under a pointer. |
| `accent_pressed` | `accentPressed` | `#2f54c4ff` | `#3552bfff` | `accent` under a press. |
| `on_accent` | `onAccent` | `#ffffffff` | `#ffffffff` | Black or white — whichever a reader can see on `accent`. What a button's label is. |
| `accent_soft` | `accentSoft` | `#3b5bd44d` | `#3b5bd429` | The accent as a translucent wash rather than a fill: a selected menu row, a chosen tab, a highlighted list item. Keeps `fg` readable over it on both bases, which a fill does not. |
| `selection` | `selection` | `#3b5bd466` | `#3b5bd447` | What a text selection is painted under, in an editor and over a `selectable` scope alike. |
| `focus_ring` | `focusRing` | `#7f9cf5ff` | `#3b5bd4ff` | The default keyboard focus ring (ADR 0002). |
| `hover` | `hover` | `#ffffff14` | `#0000000f` | A translucent wash over a hovered neutral control. An overlay, not a fill, so one value works on every surface. |
| `pressed` | `pressed` | `#ffffff24` | `#0000001f` | The same over a pressed one, and the firmer of the two on both bases. |
| `success` | `success` | `#73d98cff` | `#1a7a3eff` | A good outcome. Readable on `surface` on both bases, which is why it is not one colour for both. |
| `warning` | `warning` | `#d9a14dff` | `#8a5c08ff` | Something that wants attention. |
| `danger` | `danger` | `#e85d5dff` | `#c02b2bff` | A destructive action or a failure. The close button's hover, too. |
| `scrollbar` | `scrollbar` | `#ffffff2e` | `#00000038` | The scrollbar thumb at rest. |
| `scrollbar_active` | `scrollbarActive` | `#ffffff66` | `#0000006b` | The thumb while hovered or dragged. |

## Metrics

The sizes the stock widgets are built from, as roles beside the palette's
(backlog T2): the argument for a theme, one axis over — a button of the
app's own and the stock one should agree on a radius and a padding without
either copying a number out of the other. Logical px, applied *before* the
scale factor, which is the renderer's; a metric never scales by itself.
Density is the app's to choose, the way the palette is: the **stock** set
is what the widgets always drew, **compact** is a dense tool's (smaller
text, shallower padding, sharper corners, the titlebar at the platform's
height either way), and every length can be multiplied for a density
slider (`Metrics::scaled`, `scale` in `setMetrics`).

Read it as `ui.metrics()` in Rust, `env.metrics` in Lua, `ctx.metrics()` /
`win.metrics()` in Node and `kui_metrics` in C; set it with
`Core::set_metrics`, `ctx.setMetrics` and `kui_metrics_set` (a Lua
script reads but does not set, as with the theme). The conformance corpus
runs with the stock set, which is what keeps "the stock button is 15-px
text in 14×8 padding" a sentence about kui rather than about an app.

A value written `32 / 34` is the platform's own — Windows first, then
everywhere else — and `compact` leaves it alone.

| metric | Node | stock | compact | description |
|---|---|---|---|---|
| `control_text` | `controlText` | 15 | 13 | A stock control's label: the button's text size. |
| `chrome_text` | `chromeText` | 13 | 12 | The chrome's text: a menu row, a menu-bar title, the titlebar's title. |
| `hint_text` | `hintText` | 12 | 11 | A tooltip's text. |
| `radius` | `radius` | 6 | 4 | The corner of every stock surface: a button, a field, a menu, a tooltip. |
| `radius_inner` | `radiusInner` | 4 | 3 | The corner of a row inside one: a menu row, a menu-bar title. |
| `control_pad_x` | `controlPadX` | 14 | 10 | A button's horizontal padding. |
| `control_pad_y` | `controlPadY` | 8 | 5 | A button's vertical padding. |
| `field_pad_x` | `fieldPadX` | 10 | 8 | A text field's horizontal padding. |
| `field_pad_y` | `fieldPadY` | 8 | 5 | A text field's vertical padding. |
| `hint_pad_x` | `hintPadX` | 10 | 8 | A tooltip's horizontal padding. |
| `hint_pad_y` | `hintPadY` | 6 | 4 | A tooltip's vertical padding. |
| `menu_pad_x` | `menuPadX` | 8 | 8 | A menu row's horizontal padding, and a menu-bar title's. |
| `menu_pad_y` | `menuPadY` | 5 | 3 | A menu row's vertical padding; a menu-bar title's is two px less. |
| `menu_width` | `menuWidth` | 200 | 180 | A menu panel's width. |
| `menu_bar_h` | `menuBarH` | 26 | 22 | The drawn menu bar's height. |
| `titlebar_h` | `titlebarH` | 32 / 34 | 32 / 34 | The titlebar strip's height: the platform's caption height, 32 on Windows and 34 elsewhere, or the window's own where the runner knows it (backlog W22) — 40 and 52 off macOS for a launcher's `medium` or `tall` titlebar under custom chrome, and under macOS custom chrome the OS's own titlebar as `window.native_controls` measures it (32, 40 or 52 on macOS 27). The stock number stands for that window's height, so a set of the app's keeps it unless it names a number of its own. Under macOS custom chrome the strip is drawn at the measured height whatever this row says (`widgets::titlebar_height`). |

## Doors

The verbs — what an app or a host *calls* on its context, as against what
it declares in the tree above — one row per verb across the five bindings
(`schema::DOORS`, backlog B1a). A cell is the binding's spelling (a
`kui_*` function; a procedure of Odin's package `kui`; a method on
both of Node's classes, or on the one it is prefixed with; a function on
Lua's `env`), the same thing in another
form (a prop, a reading, a callback, a constructor option), or — in
italics — the reason the binding has none. The reasons are the point: the
bindings are not one surface. A Lua script is a guest in the host's frame
([ADR 0067](adr/0067-slots-fold-into-components.md)) whose env is
a reading, so registering, driving, pacing and reading back are the
host's; Node's `Ctx` drives a headless core and its `KuiWindow` is
driven by the runner, so the driver's half is on `Ctx` alone; and a
Node host never paints, so the renderer's rows are C's. Odin's doors are
kui.h's, so its column follows C's: the same function without its
`kui_`, and no door where C has none.

Each binding's own test pins its column both ways: every spelling here is
a door there, and every door there is a row here — so a verb added to one
binding is a row with its other cells, or a red test. Odin's is pinned by
its generator (`nu scripts/odin.nu gen --check`).

| verb | C | Odin | Node | Lua | description |
|---|---|---|---|---|---|
| `SharedResources::add_image` | `kui_image_add` | `image_add` | `addImage` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Registers RGBA pixels and mints an id for `<image src>`. |
| `Core::update_image` | `kui_image_update` | `image_update` | `updateImage` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Replaces the pixels behind a live id, keeping the id (ADR 0025). |
| `Core::remove_image` | `kui_image_remove` | `image_remove` | `removeImage` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Drops an image; every window's atlas lets it go (backlog AR8). |
| `Core::image_pixels` | `kui_image_pixels` | `image_pixels` | *none: a Node host never paints: the renderer behind `KuiWindow` is the runner's, and a headless `Ctx` has none* | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | The pixels behind a handle, for a renderer meeting a texture quad. |
| `Core::parse_path` | `kui_path_parse` | `path_parse` | `d` on `<path>` is the string; the addon hands it to this parser | `d` on `path { }` is the string; the host hands it to this parser | SVG path data to the flat op form a `path` draws (ADR 0040): one parser, so every binding draws the same shape. |
| `Core::add_fragment` | `kui_fragment_add` | `fragment_add` | `addFragment` | `add_fragment` | Registers a WGSL function and mints an id for `<fragment src>` (ADR 0015); idempotent by source, so a Lua view or extension registers its own from `env` every frame (backlog C111). |
| `Core::remove_fragment` | `kui_fragment_remove` | `fragment_remove` | `removeFragment` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Drops a fragment; the renderer drops its pipelines (backlog AR8). |
| `Core::fragment_module_source` | `kui_fragment_source` | `fragment_source` | *none: a Node host never paints: the renderer behind `KuiWindow` is the runner's, and a headless `Ctx` has none* | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | The whole WGSL module behind a handle, which is what a renderer compiles. |
| `Core::add_font_data` | `kui_font_add` | `font_add` | `addFont` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Registers a font's bytes and mints an id for `font`. |
| `Core::add_system_font` | `kui_font_add_system` | `font_add_system` | `addSystemFont` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Registers an installed family by name. |
| `Core::load_font_file` | `kui_font_load_file` | `font_load_file` | `loadFontFile` | `load_font_file` | Registers a font file by path. Its family is then drawn by name — `family = "Name"`, or a family token's list — as an installed one is, and listed by `system_font_families`. Lua (backlog C117) answers the family's name, or nil and why; a relative path is the script's folder's (a `kui run` app's or Kit's, the app's folder; a packed app's, its extracted folder), and the same path twice is the same font, so a view may call it every frame. |
| `Core::load_fonts_dir` | `kui_font_load_dir` | `font_load_dir` | `loadFontsDir` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Registers every font file in a directory. |
| `Core::reload_system_fonts` | `kui_font_reload_system` | `font_reload_system` | `reloadSystemFonts` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Scans the system's fonts again, so a font installed while the app runs is found (the scan is otherwise once a process); returns how many faces came and went. |
| `Core::set_fallback_fonts` | `kui_font_set_fallback` | `font_set_fallback` | `setFallbackFonts` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | The fonts asked, in order, for a character the text's own family lacks, before the platform's fallback list (backlog F121). |
| `Core::fallback_fonts` | *none: the list is the one the host set* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: the list is the one the host set* | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | The families `set_fallback_fonts` named, in order. |
| `Core::remove_font` | `kui_font_remove` | `font_remove` | `removeFont` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Drops a font. |
| `Core::system_font_families` | `kui_font_families` | `font_families` | `systemFontFamilies` | `system_font_families` | The installed family names `add_system_font` accepts. |
| `Core::system_fonts` | `kui_system_fonts` | `system_fonts` | `systemFonts` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | The same families, each with what the font database read off its faces: `monospaced` (every face fixed-pitch), `weights`, `italic` (backlog F97) — a font picker's monospaced-first list without a file loaded or a glyph shaped. |
| `Core::add_sound` | `kui_sound_add` | `sound_add` | `addSound` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Registers a sound's bytes and mints an id for `<audio src>`, `clickSound` and `play`. |
| `Core::remove_sound` | `kui_sound_remove` | `sound_remove` | `removeSound` | *none: a script owns no handle: the host registers and the script names the id it was given (`image { id = }`, `font = id`, `audio { src = id }`)* | Drops a sound. |
| `Core::set_text_cache_budget` | `kui_set_text_cache_budget` | `set_text_cache_budget` | `setTextCacheBudget` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The shaped-text cache's byte budget (backlog C16). |
| `Core::text_cache_bytes` | `kui_text_cache_bytes` | `text_cache_bytes` | `textCacheBytes` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | What the shaped-text cache holds. |
| `Ui::play` | `kui_play` | `play` | `play` | *none: a script owns no sound handle, and its env is the view's: a playback started there would start again every frame — `audio { src = id }` is the declarative form, and what a script has* | Starts a playback of a registered sound, outside any node; answers the playback id. |
| `Core::stop` | `kui_stop` | `stop` | `stop` | *none: as `play`: a script declares `audio { }` and stops it by not declaring it* | Stops a playback, with an optional fade. |
| `Core::set_volume` | `kui_set_volume` | `set_volume` | `setVolume` | `audio { volume = }` applies live | A playback's volume, with an optional tween. |
| `Core::pause` | `kui_pause` | `pause` | `pause` | `audio { paused = true }` applies live | Pauses a playback. |
| `Core::resume` | `kui_resume` | `resume` | `resume` | `audio { paused = false }` | Resumes a paused playback. |
| `Core::set_master_volume` | `kui_set_master_volume` | `set_master_volume` | `setMasterVolume` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The device's master volume, with an optional tween. |
| `Ui::announce` | `kui_announce` | `announce` | `announce` | `announce` | Says something once with no node behind it (ADR 0001). |
| `Core::take_announcements` | `kui_take_announcements` | `take_announcements` | `Ctx.announcements` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Drains what was announced, for a host bridging assistive technology; a `KuiWindow`'s bridge is the runner's. |
| `Core::access_tree` | `kui_access_tree` | `access_tree` | `accessTree` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The access tree of the last finished frame (ADR 0001). |
| `Ui::focus` | `kui_focus` | `focus` | `focus` | `set_focus` | Moves focus to a node now; an app's move stands over a modal's restore (backlog AR17). `keyFocus` is the declarative, edge-triggered form. |
| `Ui::blur` | `kui_focus(ctx, 0)` | `focus(ui, 0)` | `blur` | `blur` | Drops focus. |
| `Ui::focus_next` | `kui_focus_next` | `focus_next` | `focusNext` | `focus_next` | Steps the Tab ring forward (ADR 0002). |
| `Ui::focus_prev` | `kui_focus_next(ctx, false)` | `focus_next(ui, false)` | `focusPrev` | `focus_prev` | Steps the Tab ring backward. |
| `Ui::focus_region` | `kui_focus_region` | `focus_region` | `focusRegion` | `focus_region` | Enters a `focusRegion`'s ring, or leaves it for the main one (ADR 0022). |
| `Ui::focus_item` | `kui_focus_item` | `focus_item` | `focusItem` | `focus_item` | Focuses item `index` of a list, table or other composite, named by its key (backlog C125): the item opened with that data `index` — a row a windowed composite did not build is scrolled to and landed on the frame that builds it, an index past `rowCount` being the last row — else, where items carry no index, the item at that place. Lands when the frame ends, so a view may name the composite it is declaring. A focused item that vanishes hands focus to the item now at its place on its own; this names one. |
| `Ui::region` | `kui_region` | `region` | `region` | `env.region`, a reading | The region in effect. |
| `Ui::focused` | `kui_focused` | `focused` | `focused` | `env.focus`, a reading | The focused node's key. |
| `Ui::is_focused` | `kui_is_focused` | `is_focused` | `isFocused` | `is_focused` | Whether a node has focus. |
| `Ui::focus_visible` | `kui_focus_visible` | `focus_visible` | `focusVisible` | `env.focus_visible`, a reading | Whether focus came from the keyboard and the ring should show. |
| `Core::answer_typeahead` | `kui_answer_typeahead` | `answer_typeahead` | `answerTypeahead` | `answer_typeahead` | The app's answer to a `typeahead` event (ADR 0070): the data index of the row its search names, which the core reaches for in the composite that asked — landing on it, or scrolling to it and landing the frame that builds it. False when that composite asked nothing, or focus has left it. |
| `Ui::set_rules_appearance` | `kui_set_rules_appearance` | `set_rules_appearance` | `setRulesAppearance` | `set_rules_appearance` | Sets the appearance the caller's `dark` / `light` conditions read in place of the palette's (backlog C113): an add-on holding its own look light or dark — Kit's `settings.appearance` — has its `when` entries agree with its colours. Per origin, kept until set again; unknown (C 0, Lua and Node nil) gives the palette's back. |
| `Ui::platform` | `kui_platform` | `platform` | `env().platform`, a reading | `env.platform`, a reading | The platform the app runs on (backlog C116): macOS, Windows, Linux or Other (`"macos"` / `"windows"` / `"linux"` / `"other"` in Lua and Node, a `KUI_PLATFORM_*` in C), the fact a `when` entry's `platform` condition reads, so a script following a platform's convention and a rule following it agree. |
| `Core::set_platform` | *none: the platform is the build's; a test that fakes another is a Rust test* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: the platform is the build's; a test that fakes another is a Rust test* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Says the core runs on another platform than the build's (backlog C116): a test of one platform's convention on another machine, or a headless run pinned to another platform's look (`Launcher::platform`, `kui run --platform`, backlog F220). The `platform` conditions and the env reading follow, and so does every choice the core makes by platform: a drawn menu's shortcut labels, the primary modifier, the editing keys' modifiers, glyph hinting and the titlebar's caption height. |
| `Ui::tab_moves_focus` | `kui_tab_moves_focus` | `tab_moves_focus` | `tabMovesFocus` | `env.tab_moves_focus`, a reading | Whether the window's "Tab moves focus" toggle is on (backlog C99): a multiline editor whose Tab would type walks the ring instead. Ctrl+M flips it in such an editor (Ctrl+Shift+M on macOS); what a status label reads. |
| `Ui::key_of` | `kui_key_of` | `key_of` | `keyOf` | every query and verb takes the label itself (`key_query`) | The key a key label names this frame: the name the view opened the node under, not the one a reader hears. |
| `Core::key_named` | `kui_key_named` | `key_named` | `keyNamed` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The key of the first node a reader hears named so in the last frame: a test presses the button named Like. |
| `Core::label_of` | `kui_label_of` | `label_of` | `labelOf` | `label_of` | The label a key was opened under, in the frame being built and then the last one; none for an auto-keyed node. The reverse of `key_of`. |
| `Ui::caret_visible` | `kui_caret_visible` | `caret_visible` | `caretVisible` | `env.caret_visible`, a reading | The blink phase a custom editor draws its caret on. |
| `Core::set_caret_visible` | `kui_set_caret_visible` | `set_caret_visible` | `setCaretVisible` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The host's blink clock writes the phase. |
| `Core::has_caret` | `kui_has_caret` | `has_caret` | `hasCaret` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether anything focused draws a caret to blink — a `caretSolid` line's is not one — which arms a host's blink clock. |
| `Core::caret_stamp` | `kui_caret_stamp` | `caret_stamp` | the loop in `index.js` runs the blink from `nextDeadlineMs`; a headless `Ctx` never blinks | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Changes when the caret moves or focus does, which re-arms the clock solid. |
| `Ui::is_hovered` | `kui_is_hovered` | `is_hovered` | `isHovered` | `is_hovered` | Whether the pointer is over a node. |
| `Ui::is_pressed` | `kui_is_pressed` | `is_pressed` | `isPressed` | `is_pressed` | Whether a press started on a node and the pointer is still over it. |
| `Ui::is_drop_target` | `kui_is_drop_target` | `is_drop_target` | `isDropTarget` | `is_drop_target` | Whether files dragged in from the OS are over a node (ADR 0031) — for drop-dependent layout; the colour is `drop_bg`. |
| `Core::drop_target` | `kui_drop_target` | `drop_target` | `dropTarget` | `drop_target` | The drop zone the dragged files are over, if any — what a driver answers the OS with, and what a test reads to say a zone was found (ADR 0031, decision 5). |
| `Ui::is_group_hovered` | `kui_is_group_hovered` | `is_group_hovered` | `isGroupHovered` | `is_group_hovered` | Whether any member of a hover group is hovered: Rust takes the id (`NodeSpec::hover_group_id`), every binding the `hoverGroup` name. `hoverBg` on a member paints it without asking. |
| `Ui::is_group_pressed` | `kui_is_group_pressed` | `is_group_pressed` | `isGroupPressed` | `is_group_pressed` | Whether any member of a hover group holds a press (backlog C92), by id in Rust and by name elsewhere: what a widget drawn from several pieces styles its pressed state from; `pressedBg` on a member paints it without asking. |
| `Core::cursor` | *none: the pointer's position is the driver's own fact — it injected it* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: the same reason as C's* | *none: the same reason as C's, one step removed* | Where the pointer is, in logical viewport px. |
| `Core::cursor_shape` | `kui_cursor_shape` | `cursor_shape` | `cursorShape` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The pointer shape the frame asks for, which the host sets on its window. |
| `Ui::layout_of` | `kui_layout_of` | `layout_of` | `layoutOf` | `layout_of` | Where layout put a node last frame (backlog C26). |
| `Ui::pointer_in` | `kui_pointer_in` | `pointer_in` | `pointerIn` | `pointer_in` | Where the pointer is over a node, from its top-left, and the node's size (backlog C119). |
| `Ui::scroll_offset` | `kui_scroll_offset` | `scroll_offset` | `scrollOffset` | `scroll_offset` | A scrolling node's offset. |
| `Ui::scroll_geometry` | `kui_scroll_geometry` | `scroll_geometry` | `scrollGeometry` | `scroll_geometry` | A scrolling node's viewport and content sizes. |
| `Ui::set_scroll` | `kui_set_scroll` | `set_scroll` | `setScroll` | `set_scroll` | Scrolls a node to an offset. |
| `Ui::shift_scroll` | `kui_shift_scroll` | `shift_scroll` | `shiftScroll` | `shift_scroll` | Moves a node's scroll by content that moved under it, with no ease: a variable-height list's anchor (backlog C46). |
| `Ui::edge_scroll` | `kui_edge_scroll` | `edge_scroll` | `edgeScroll` | `edge_scroll` | Scrolls a node for a drag the app holds with the pointer in the edge zone inside a rect, by the edge scroll's feel — on an axis it cannot move, the container around it, as the wheel chains, unless one says `overscroll: contain`; returns what moved and asks for the next frame while it moves (ADR 0029). |
| `Ui::reveal` | `kui_reveal` | `reveal` | `reveal` | `reveal` | Scrolls whatever encloses a node until it is in view. |
| `Ui::text_hit` | `kui_text_hit` | `text_hit` | `textHit` | `text_hit` | The byte and line under a point in a node's text (backlog C18). |
| `Ui::caret_rect` | `kui_caret_rect` | `caret_rect` | `caretRect` | `caret_rect` | The caret rect for a byte offset in a node's text. |
| `Core::ime_rect` | `kui_ime_rect` | `ime_rect` | `imeRect` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Where the OS candidate window goes, which the host hands to the platform (backlog C17). |
| `Ui::measure_text` | `kui_measure_text` | `measure_text` | `measureText` | `measure_text` | Shapes text in a style at a width and answers its size and line count. |
| `Ui::measure_rich_text` | `kui_measure_rich_text` | `measure_rich_text` | `measureText` takes spans too | `measure_text` takes spans too | The same for spans, shaped as one paragraph. |
| `Ui::caret_in_text` | `kui_caret_in_text` | `caret_in_text` | `caretInText` | `caret_in_text` | Where a byte lands in a text wrapped at a width, before any node drew it: a caret on the frame its text is new (backlog F171). |
| `Ui::caret_in_rich_text` | `kui_caret_in_rich_text` | `caret_in_rich_text` | `caretInText` takes spans too | `caret_in_text` takes spans too | The same for spans, shaped as one paragraph. |
| `Ui::edit_text` | `kui_edit_text` | `edit_text` | `editText` | `edit_text` | An editor's text, by key or by label. |
| `Ui::set_edit_text` | `kui_edit_set_text` | `edit_set_text` | `setEditText` | `set_edit_text` | Replaces an editor's text, caret at the end. |
| `Ui::set_edit_text_by_label` | `kui_edit_set_text_label` | `edit_set_text_label` | `setEditText` takes the label too | `set_edit_text` takes the label too | The same by the label an editor's `key` declares, which reaches one the frame is about to declare (backlog AR26). |
| `Core::animating` | `kui_animating` | `animating` | `animating` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether the last frame left a transition mid-flight, so the host draws another without waiting for input. |
| `Core::owed` | `kui_owed` | `owed` | `owed` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The same by kind — a finite transition, a keyframe cycle, a departing ghost, a requested frame, an autoscroll — so a test can wait for the transitions to run out under a cycle that never ends; Node's loop has `quiet()` for that wait (backlog F64). |
| `Core::set_frame_trace` | `kui_set_frame_trace` | `set_frame_trace` | `setFrameTrace` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Turns on the trace of why frames run: who holds an owed frame, and whether a frame changed what is drawn (backlog F111). |
| `Core::frame_cause` | `kui_frame_cause` | `frame_cause` | `frameCause` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Why the frame being built runs: the input it answers by kind, what the driver noted, and `owed` after a frame that owed one (backlog F111). |
| `Core::begin_frame_cause` | *none: a C host's view runs between `kui_frame_begin` and `kui_frame_finish`, inside the frame it builds, so it reads that frame already* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | `Ctx.beginFrameCause` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Starts the next frame's record ahead of its `begin_frame`, for a driver whose view runs before the frame it is for — Node's loop — so `frame_cause` and `owed_by` read from the view answer that frame (backlog RG81). |
| `Core::note_frame_cause` | `kui_note_frame_cause` | `note_frame_cause` | *none: the drivers that note a reason are kui-native's, which a `KuiWindow` runs on; a `Ctx` driven by hand has nothing but the input the core already records* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | A driver adds a reason the core cannot see — a wake, a resize, a blink, a retry — to the next frame's (backlog F111). |
| `Core::reframe` | *none: a C host builds its frames by hand, so whether the view it skips read nothing that moved is the host's to know; kui-native's drivers ask their `App::view_state` and every extension's `root_state`* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: a `KuiWindow` runs on kui-native's driver, which asks the app's `view_state`; the addon does not answer it with its retained tree's revision yet (backlog C140)* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Builds the frame about to begin from the last tree, its cycles and transitions sampled again, when only an animation of the core's own asks for it and nothing the last build read has moved (backlog C138). |
| `Core::owed_by` | *none: lists of named holders are strings the library would own across calls, an [out-array] struct and an ABI bump for a reading that is a debugging aid; a C host reads the kinds from `kui_owed`* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | `owedBy` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Who holds the frame the last one left owed: `owed` with the nodes, slots and calling lines named (backlog F111). |
| `Core::frame_unchanged` | `kui_frame_unchanged` | `frame_unchanged` | `frameUnchanged` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether the last finished frame drew exactly what the one before drew, traced (backlog F111). |
| `gpu::shader` | `kui_renderer_wgsl` | `renderer_wgsl` | *none: a Node host never paints: the renderer behind `KuiWindow` is the runner's, and a headless `Ctx` has none* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The WGSL that draws the display list, with or without dual-source blending: what kui-wgpu compiles, for a host with its own device (backlog F234). |
| `gpu::instance_stride` | `kui_instance_stride` | `instance_stride` | *none: a Node host never paints: the renderer behind `KuiWindow` is the runner's, and a headless `Ctx` has none* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The bytes one packed instance takes: the vertex buffer's stride (backlog F234). |
| `gpu::instance_attributes` | `kui_instance_attributes` | `instance_attributes` | *none: a Node host never paints: the renderer behind `KuiWindow` is the runner's, and a headless `Ctx` has none* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Each instance attribute's shader location, float count and byte offset: a pipeline built from these follows a later library's layout (backlog F234). |
| `gpu::instance_of` | `kui_pack_instances` | `pack_instances` | *none: a Node host never paints: the renderer behind `KuiWindow` is the runner's, and a headless `Ctx` has none* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The finished frame's quads as the shader's instances, packed into the host's buffer (backlog F234). |
| `Core::new_in` | `kui_ctx_new_in` | `new_ui_in` | `Ctx.sibling` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | A context in another's session (backlog F237): the same registered fonts, images and sounds and the same shaping caches, so several HUDs or islands load and shape nothing twice; tree, focus, events and glyph atlas are its own. One thread's, as the first is. Node's `KuiWindow`s share theirs through the runner already. |
| `Core::hit` | `kui_hit` | `hit` | `Ctx.hit` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The topmost node at a point that blocks a host's world — a node kui takes the pointer on, or a box that paints unless it says `hostHit: pass`, or one that says `hostHit: block` — as of the last finished frame; none for the world (backlog F233). For a game, a map or a 3D view drawing the UI over a world of its own. Node's `KuiWindow` has no world under it. The painted boxes are recorded only once something asks: C's, Odin's and Node's contexts from their creation, a Rust `Core` from its first ask (which owes the frame that records them) or `Core::arm_host_hit`. |
| `Core::pointer_wants` | `kui_pointer_wants` | `pointer_wants` | `Ctx.pointerWants` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether the pointer is the UI's now: over a node `hit` answers for, held by something kui started (a press, a drag, a slider, a selection), or anywhere while a menu is open or a modal is in effect — Dear ImGui's `WantCaptureMouse` (backlog F233). |
| `Core::keyboard_wants` | `kui_keyboard_wants` | `keyboard_wants` | `Ctx.keyboardWants` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether the keyboard is the UI's now: an editor has focus, the focused node is a key sink, or a menu is open — Dear ImGui's `WantCaptureKeyboard` (backlog F233). |
| `Ui::request_frame` | `animate` on a node, and `kui_animating` for the driver to read | `animate` on a node, and `animating` for the driver to read | the same form as C's | the same form as C's | Asks for a frame after this one; the driver paces off `animating()`. |
| `Ui::modifiers` | *none: the held modifiers ride on every key and pointer event's `mods`; the reader is what the stock editor's Shift-drag asks, inside the core* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: the same reason as C's* | *none: the same reason as C's* | The modifier keys held now. |
| `Ui::selection_text` | `kui_selection_text` | `selection_text` | `selectionText` | `selection_text` | The window's selected text — a scope's, a grid's or the focused editor's. |
| `Ui::selection_html` | `kui_selection_html` | `selection_html` | `selectionHtml` | `selection_html` | The same with the formatting the text declared. |
| `Ui::selection_ends` | `kui_selection_ends` | `selection_ends` | `selectionEnds` | `selection_ends` | A text selection's anchor and focus as row indices and bytes (ADR 0029). |
| `Ui::cell_selection` | `kui_cell_selection` | `cell_selection` | `cellSelection` | `cell_selection` | A `cells` grid's selection: its ends as absolute lines and columns, and whether it is a block (ADR 0017 §4). |
| `Ui::select_all_in` | `kui_select_all_in` | `select_all_in` | `selectAllIn` | `select_all_in` | Select All, scoped to a `selectable` node or a grid. |
| `Ui::clear_selection` | `kui_clear_selection` | `clear_selection` | `clearSelection` | `clear_selection` | Drops the window's selection. |
| `Ui::request_copy` | `kui_request_copy` | `request_copy` | `requestCopy` | `request_copy` | Asks for the selection as a copy, which may come back as a `selectionrange` question. |
| `Ui::answer_selection_range` | `kui_answer_selection_range` | `answer_selection_range` | `answerSelectionRange` | `answer_selection_range` | The app's answer to that question. |
| `Ui::set_clipboard` | `kui_set_clipboard` | `set_clipboard` | `setClipboard` | `set_clipboard` | A key sink's own Ctrl-C: posts a clipboard action for the host (backlog C33). |
| `Ui::set_clipboard_secret` | `kui_set_clipboard_secret` | `set_clipboard_secret` | `setClipboardSecret` | `set_clipboard_secret` | Posts a secret for the clipboard, which the host writes marked concealed and transient the way a password manager does, so no clipboard manager shows or keeps it (backlog F84). |
| `Ui::set_clipboard_files` | `kui_set_clipboard_files` | `set_clipboard_files` | `setClipboardFiles` | `set_clipboard_files` | Posts files for the clipboard, which the host writes as the platform's file list — CF_HDROP, file URLs, text/uri-list — so they paste into a file manager or a mail as the files: "Copy file" (backlog F247). |
| `Ui::set_clipboard_image` | `kui_set_clipboard_image` | `set_clipboard_image` | `setClipboardImage` | *none: a script holds no pixels: capturing and decoding are the host's* | Posts a picture for the clipboard — straight RGBA, a capture or a decoded image — which the host writes as the platform's image type: "Copy image" (ADR 0055). |
| `Ui::request_paste` | `kui_request_paste` | `request_paste` | `requestPaste` | `request_paste` | A key sink's own Ctrl-V: the clipboard comes back as a commit, marked `concealed` / `transient` when the pasteboard said so (backlog F84). One ask at a time — a second while one is unanswered is dropped. |
| `Ui::awaiting_paste` | `kui_awaiting_paste` | `awaiting_paste` | `awaitingPaste` | `awaiting_paste` | Whether a paste asked for is still unanswered (backlog AR34). |
| `Ui::request_files` | `kui_request_files` | `request_files` | `requestFiles` | `request_files` | Asks for the platform's Open, Save or folder dialog; the answer is a `files` event to whoever asked. One at a time — a second while one is out is dropped (backlog C51). |
| `Ui::awaiting_files` | `kui_awaiting_files` | `awaiting_files` | `awaitingFiles` | `awaiting_files` | Whether a file dialog asked for is still unanswered. |
| `Core::take_file_requests` | `kui_take_file_request`, then `kui_file_request_filter` per filter | `take_file_request`, then `file_request_filter` per filter | `takeFileRequests` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Drains the dialog asked for, for a host that shows it itself; the runner does. The answer goes back as input (`Ctx.answerFiles`, `kui_input_files`). |
| `Core::set_lookup_available` | `kui_set_lookup_available` | `set_lookup_available` | `setLookupAvailable` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether the host can show the platform's definition panel, which decides whether Look Up is offered. |
| `Ui::open_menu` | `kui_open_menu` | `open_menu` | `openMenu` | `open_menu` | Opens a context menu on a node at a point. |
| `Ui::close_menu` | `kui_close_menu` | `close_menu` | `closeMenu` | `close_menu` | Closes it. |
| `Core::take_menu_actions` | `kui_take_menu_action` | `take_menu_action` | `takeMenuActions` | a chosen row comes back as a `menu` event on the node; the clipboard actions are the host's | Drains what a menu (or a chord, or the standard bar) asked of the host: a clipboard write, a paste, a Look Up. |
| `Core::menu` | `kui_menu_item_count` / `kui_menu_item`, one row at a time, and a submenu's by path with `kui_menu_submenu_count` / `kui_menu_item_path` | `menu_item_count` / `menu_item`, one row at a time, and a submenu's by path with `menu_submenu_count` / `menu_item_path` | `menu` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The open menu, for a host showing it natively. |
| `Core::set_native_menus` | `kui_set_native_menus` | `set_native_menus` | `setNativeMenus` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether the host shows menus itself; the core then draws none. |
| `Core::activate_menu_item` | `kui_activate_menu_item` | `activate_menu_item` | `activateMenuItem` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Reports that the host's own menu chose a row; a row that cannot be chosen (disabled, a separator) is refused and the menu stays open. |
| `Core::activate_menu_path` | `kui_activate_menu_path` | `activate_menu_path` | `activateMenuPath` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | `activate_menu_item` for a row inside a submenu, by its path through the rows' submenus (backlog F128); a row that opens a submenu is refused. |
| `Menu::max_size` | `kui_open_menu_with` | `open_menu_with` | `openMenu`'s fifth argument, `{maxWidth, maxHeight}` | `open_menu`'s fifth argument, `{ max_width =, max_height = }` | Holds a context menu and its submenus to a size: a row wider is ellipsized, a menu taller scrolls; an axis left out is the room's (backlog F210). |
| `Menu::in_window` | `KUI_MENU_IN_WINDOW` in `kui_open_menu_with`'s flags | `MENU_IN_WINDOW` in `open_menu_with`'s flags | `openMenu`'s fifth argument, `{inWindow: true}` | `open_menu`'s fifth argument, `{ in_window = true }` | Keeps a context menu drawn in the window where the runner would show one that does not fit in a popup window of its own (backlog F210). |
| `Core::set_menu_popups` | *none: the runner that opens the windows places the menus: `kui_run`'s and `runWindowed`'s are kui-native's, which do* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: the runner that opens the windows places the menus: `kui_run`'s and `runWindowed`'s are kui-native's, which do* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether the host shows a context menu that does not fit the window in a popup window of its own; a menu then waits, drawn nowhere, until `set_menu_in_popup` says where (backlog F210). |
| `Core::set_menu_in_popup` | *none: the runner that opens the windows places the menus: `kui_run`'s and `runWindowed`'s are kui-native's, which do* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: the runner that opens the windows places the menus: `kui_run`'s and `runWindowed`'s are kui-native's, which do* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Where the open menu goes: in the host's popup window, the core keeping it and drawing none of it, or in the window (backlog F210). |
| `Core::open_menu_popup` | *none: the runner that opens the windows places the menus: `kui_run`'s and `runWindowed`'s are kui-native's, which do* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: the runner that opens the windows places the menus: `kui_run`'s and `runWindowed`'s are kui-native's, which do* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Makes a core a menu's popup window: its frame is the rows and nothing else, and a row chosen, Escape and the Left arrow are said back (`take_menu_popup_answer`) rather than performed; a submenu's row is `menu_popup_submenu` (backlog F210). |
| `Core::menu_bar` | `kui_menu_bar_menu_count` / `kui_menu_bar_menu` / `kui_menu_bar_item`, one row at a time, and a submenu's by path with `kui_menu_bar_submenu_count` / `kui_menu_bar_item_path`; whether it keeps the standard menus with `kui_menu_bar_has_standard_menus` | `menu_bar_menu_count` / `menu_bar_menu` / `menu_bar_item`, one row at a time, and a submenu's by path with `menu_bar_submenu_count` / `menu_bar_item_path`; whether it keeps the standard menus with `menu_bar_has_standard_menus` | `menuBar` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The declared menu bar, for a host handing it to the OS. |
| `Core::set_native_menu_bar` | `kui_set_native_menu_bar` | `set_native_menu_bar` | `setNativeMenuBar` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether the host owns the bar; the core then draws no strip. |
| `Core::activate_menu_bar_item` | `kui_activate_menu_bar_item` | `activate_menu_bar_item` | `activateMenuBarItem` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Reports that the OS bar chose a row. |
| `Core::activate_menu_bar_path` | `kui_activate_menu_bar_path` | `activate_menu_bar_path` | `activateMenuBarPath` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | `activate_menu_bar_item` for a row inside a submenu, by its path (backlog F128). |
| `Ui::window` | `kui_window_declare` | `window_declare` | the root's `windows` prop | the root's `windows` field | Declares that a named window exists this frame (ADR 0003 step 3). |
| `Ui::window_with` | `kui_window_declare_with` | `window_declare_with` | a `windows` entry's `onWindow` / `onDismiss` | a `windows` entry's `on_window` / `on_dismiss` | Declares a window with the messages its opening, closing and a popup's dismissal arrive as (ADR 0048). |
| `Core::windows` | the ids arrive on `KUI_CMD_OPEN`; a host keeps the list it opened | the ids arrive on `take_window_command`'s `.Open`; a host keeps the list it opened | `windows` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The names of the windows open now. |
| `Ui::window_name` | `kui_ctx_window_name` | `ctx_window_name` | `windowName` | `window_name` | The name of the window this context draws. |
| `Ui::set_window_size` | `kui_set_window_size` | `set_window_size` | `setWindowSize` | `set_window_size` | Asks the driver to resize a window. |
| `Ui::focus_window` | `kui_focus_window` | `focus_window` | `focusWindow` | `focus_window` | Asks the driver to bring a window to the front. |
| `Ui::window_title` | `kui_window_title` | `window_title` | the root's `title` prop | the root's `title` field | Declares the window's title this frame. |
| `Ui::display_names` | *none: the host enumerates its own displays* | *none: the host enumerates its own displays* | `displayNames` | `display_names` | The driver's current display names, indexed from zero; empty headlessly. Display indices may change when displays are connected or removed. |
| `Ui::set_window_fullscreen` | `kui_set_window_fullscreen` | `set_window_fullscreen` | `setWindowFullscreen` | `set_window_fullscreen` | Requests borderless fullscreen on the current or chosen display. A driver may decline; read window.fullscreen for the result. |
| `Ui::set_window_visible` | `kui_set_window_visible` | `set_window_visible` | `setWindowVisible` | `set_window_visible` | Shows or hides a window without discarding its context or session state. |
| `Ui::set_window_close_hides` | `kui_set_window_close_hides` | `set_window_close_hides` | `setWindowCloseHides` | `set_window_close_hides` | Opts into OS/chrome close hiding a window while another normal window remains visible. Closing the last visible window or explicitly quitting ends the session. |
| `Ui::always_on_top` | `kui_set_always_on_top` | `set_always_on_top` | the root's `alwaysOnTop` prop | the root's `always_on_top` field | Declares that the window sits above every other app's this frame (backlog C30). |
| `Ui::secure_input` | `kui_set_secure_input` | `set_secure_input` | the root's `secureInput` prop | the root's `secure_input` field | Declares that this frame wants secure keyboard entry while the window has the keyboard — a password prompt (backlog F85). |
| `Ui::option_as_alt` | `kui_set_option_as_alt` | `set_option_as_alt` | the root's `optionAsAlt` prop | the root's `option_as_alt` field | Declares which Option keys act as Alt in this window on macOS, so a dead key like ⌥u arrives as `<A-u>` (backlog F113). |
| `Ui::ime_off` | `kui_set_ime_off` | `set_ime_off` | the root's `imeOff` prop | the root's `ime_off` field | Declares that this window takes the keyboard as keys, with the input method off — no composition, and on a Mac no dead keys and no press-and-hold, so a held letter repeats (backlog F125). |
| `Ui::window_command` | the chrome roles (`KuiSpec.window_role`) are the door; the verb is what `widgets::window_buttons` lowers to | `window` on a node (`Spec.window`, the chrome roles) is the door | `KuiWindow.close()` for the one command the runner takes from outside a frame; the rest are `windowRole` | `window_role` | Minimize, toggle-maximize, start-drag, close — what a chrome node asks for on a press. |
| `Core::window_title` | `kui_window_title_get` | `window_title_get` | `Ctx.windowTitle` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | What the frame declared, for a driver applying it; a `KuiWindow` applies its own. |
| `Core::always_on_top` | `kui_always_on_top_get` | `always_on_top_get` | `Ctx.alwaysOnTop` | `env.window.always_on_top`, a reading | The same for the level. |
| `Core::secure_input` | `kui_secure_input_get` | `secure_input_get` | `Ctx.secureInput` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The same for the secure-input ask: what a driver with its own loop reads to make the platform call; the runner makes it for a `KuiWindow` and `kui_run`. |
| `Core::option_as_alt` | `kui_option_as_alt_get` | `option_as_alt_get` | `Ctx.optionAsAlt` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The same for the Option-as-Alt ask: what a driver with its own loop reads to apply it to its window; the runner applies it for a `KuiWindow` and `kui_run`. |
| `Core::ime_off` | `kui_ime_off_get` | `ime_off_get` | `Ctx.imeOff` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The same for the input-method ask: what a driver with its own loop reads to apply it to its window; the runner applies it for a `KuiWindow` and `kui_run`. |
| `Core::take_window_commands` | `kui_take_window_command` | `take_window_command` | `Ctx.windowCommands` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Drains what the frame asked of the driver: open, close, resize, focus, redraw. |
| `Core::window_closed` | `kui_window_closed` | `window_closed` | `Ctx.windowClosed` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The driver reports a window gone. |
| `Core::dismiss_window` | `kui_window_dismissed` | `window_dismissed` | `Ctx.windowDismissed` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The driver reports a popup dismissed, with why (ADR 0003 step 4). |
| `Core::set_theme` | `kui_theme_set` | `theme_set` | `setTheme` | *none: read-only: the palette is the host's (ADR 0019)* | Pins a whole palette. |
| `Core::set_theme_pair` | `kui_theme_set_pair` | `theme_set_pair` | `setTheme({ light, dark })`: an override object for each half | *none: as `set_theme`* | One palette for each appearance, picked from `system` every frame (ADR 0061). |
| `Theme::derive` | `kui_theme_derive` | `theme_derive` | each half of `setTheme({ light, dark })` starts from it | *none: as `set_theme`* | The stock palette for an appearance and an accent, with no context. |
| `Core::set_accent` | `kui_theme_set_accent` | `theme_set_accent` | `setAccent` | *none: as `set_theme`* | Pins an accent and keeps the OS's base. |
| `Ui::theme` | `kui_theme` | `theme` | `theme` | `env.theme`, a reading | The palette in effect (`THEME_ROLES`). |
| `Core::set_metrics` | `kui_metrics_set` | `metrics_set` | `setMetrics` | *none: as `set_theme` (backlog T2)* | Pins the stock widgets' sizes. |
| `Ui::metrics` | `kui_metrics` | `metrics` | `metrics` | `env.metrics`, a reading | The sizes in effect (`METRIC_ROLES`). |
| `Ui::set_tokens` | `kui_tokens_set` | `tokens_set` | `setTokens` | `set_tokens` | Declares the origin's colour and length tokens (ADR 0027). |
| `Tokens::family` | `kui_tokens_families` | `tokens_families` | `families` in `setTokens` | `families` in `set_tokens` | Adds font family tokens, each picked from a fallback list (ADR 0049). |
| `Core::add_dtcg` | `kui_tokens_load_dtcg` | `tokens_load_dtcg` | `kui.loadTokens` | `load_tokens` | Loads a DTCG token file or resolver (ADR 0062): colours with two halves, lengths, families; Node and Lua answer the table, C adds it. |
| `Tokens::derive` | `kui_tokens_derive` | `tokens_derive` | a colour with `from` in `setTokens` | a colour with `from` in `set_tokens` | Adds derived colours to the declared ones (ADR 0028). |
| `Ui::tokens` | `kui_token_color` / `kui_token_length` / `kui_token_family`, one name at a time | `token_color` / `token_length` / `token_family`, one name at a time | `tokens` | `env.tokens`, a reading | The tokens in effect, resolved for the appearance. |
| `Core::tokens_declared` | *none: a plugin declares in every `kui_ext_view` and pays the parse; a reader that lets it skip the second is one line, once a plugin asks for it* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: an app declares once, before its loop* | *none: the `tokens` global is declared once, at load* | Whether an origin declared tokens. |
| `Core::set_diagnostics` | `kui_set_diagnostics` | `set_diagnostics` | `setDiagnostics` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Turns the per-frame checks on. |
| `Core::set_smooth_wheel` | `kui_set_smooth_wheel` | `set_smooth_wheel` | `setSmoothWheel` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether a wheel's notch glides on a scroll container (ADR 0050): on by default; off, a notch jumps on the next frame. The system's reduced motion jumps either way. |
| `Core::smooth_wheel` | `kui_smooth_wheel` | `smooth_wheel` | `smoothWheel` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | That switch, read back. |
| `Core::set_wheel_acceleration` | `kui_set_wheel_acceleration` | `set_wheel_acceleration` | `setWheelAcceleration` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether rapid wheel notches travel farther on scroll containers. Off by default. Pixel scrolling and scroll handlers are unaffected. |
| `Core::wheel_acceleration` | `kui_wheel_acceleration` | `wheel_acceleration` | `wheelAcceleration` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | That switch, read back. |
| `Core::set_wheel_feel` | `kui_set_wheel_feel` | `set_wheel_feel` | `setWheelFeel` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | How a wheel's notch scrolls (`WheelFeel`): the base travel per line (48 px by default), the glide's response (0.27 s) and its kick (0.6). |
| `WheelFeel::preset` | `kui_set_wheel_preset`, which sets it | `set_wheel_preset`, which sets it | a name to `setWheelFeel` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | A feel by name, slow to fast: `gentle`, `relaxed`, `standard` (the default), `swift`; `brisk` aliases `standard`. |
| `Core::wheel_feel` | `kui_wheel_feel` | `wheel_feel` | `wheelFeel` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | That feel, read back as clamped. |
| `Core::set_edge_scroll_feel` | `kui_set_edge_scroll_feel` | `set_edge_scroll_feel` | `setEdgeScrollFeel` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | How a held drag scrolls a container at its edge (`EdgeScrollFeel`): the zone's depth (60 px by default), the speed at its edge (500 px/s) along a curve (2, quadratic), a ramp while held (6 times over 1.5 s), a cap (3000 px/s) and the pull-back that restarts the ramp (8 px). |
| `EdgeScrollFeel::preset` | `kui_set_edge_scroll_preset`, which sets it | `set_edge_scroll_preset`, which sets it | a name to `setEdgeScrollFeel` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | A feel by name, slow to fast: `gentle`, `standard` (the default), `brisk`. |
| `Core::edge_scroll_feel` | `kui_edge_scroll_feel` | `edge_scroll_feel` | `edgeScrollFeel` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | That feel, read back as clamped. |
| `Core::take_warnings` | `kui_take_warnings` | `take_warnings` | `warnings` | *none: the host drains and the Lua runner prints* | Drains the warnings raised since the last call. |
| `Core::warnings_raised` | *none: the C smoke round drains `kui_take_warnings` after each frame; a non-draining reader waits for a C harness that needs one* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | `warningsRaised` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The warnings raised so far, undrained, which is what an example's self-check reads (ADR 0021). |
| `Core::set_devtools` | `kui_set_devtools` | `set_devtools` | `setDevtools` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Turns the devtools panel on. |
| `Core::devtools` | `kui_devtools` | `devtools` | `devtools` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether it is on. |
| `Core::set_devtools_dock` | `kui_set_devtools_dock` | `set_devtools_dock` | `setDevtoolsDock` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Where it sits. |
| `Core::devtools_dock` | `kui_devtools_dock` | `devtools_dock` | `devtoolsDock` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Where it sits, read back. |
| `Core::host_rect` | `kui_host_rect` | `host_rect` | `hostArea` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Where the frame laid the host out in the window, logical px: the viewport with its origin, which is what tells the app's quads from the dock's (backlog F92). |
| `Core::set_devtools_theme` | `kui_set_devtools_theme` | `set_devtools_theme` | `setDevtoolsTheme` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Seeds the panel's theme override. |
| `Core::set_devtools_key` | `kui_set_devtools_key` | `set_devtools_key` | `setDevtoolsKey` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Respells the chord that moves the keyboard into the panel (`Ctrl+Shift+I` by default). |
| `Core::devtools_key` | `kui_devtools_key` | `devtools_key` | `devtoolsKey` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | That chord, read back in its portable spelling. |
| `Ui::devtools_tab` | `kui_devtools_tab` | `devtools_tab` | `<devtoolsTab name label component props/>` | `devtools_tab { name=, label=, component=, props= }` | Declares a devtools tab whose body places the component named, with the host's props and the panel's facts, while it is on show (ADR 0032, ADR 0067). |
| `Ui::devtools_tab_with` | `kui_devtools_tab_open` | `devtools_tab_open` | `<devtoolsTab name label>{() => …}</devtoolsTab>`, the function child called only while the tab is on show | `devtools_tab { name=, label=, view = function(env) … end }`, called only while the tab is on show | Declares a devtools tab the host draws itself, and draws it only while it is on show. |
| `Core::devtools_shown_tab` | *none: a C host's open answers whether the tab is on show (`kui_devtools_tab_open`); nothing encodes ahead of the core there* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | `devtoolsShownTab` | *none: the runner's converter reads it for the script (ADR 0032, decision 3)* | The declared devtools tab on show, which a data binding reads once a frame to call the tab's function. |
| `Core::devtools_selected` | `kui_devtools_selected` | `devtools_selected` | `devtoolsSelected` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The node the panel's tree tab has selected (ADR 0032, decision 4). |
| `Core::devtools_hovered` | `kui_devtools_hovered` | `devtools_hovered` | `devtoolsHovered` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The tree row under the pointer. |
| `Core::devtools_picked` | `kui_devtools_picked` | `devtools_picked` | `devtoolsPicked` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The node the picker is over. |
| `Core::set_devtools_pick` | `kui_set_devtools_pick` | `set_devtools_pick` | `setDevtoolsPick` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Raises the panel's picker from outside it, or puts it away; raised from a declared tab, the pick lands in `devtools_selected` and the tab stays up. |
| `Core::devtools_picking` | `kui_devtools_picking` | `devtools_picking` | `devtoolsPicking` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether the picker is up. |
| `Core::set_devtools_selected` | `kui_set_devtools_selected` | `set_devtools_selected` | `setDevtoolsSelected` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Selects and reveals a node in the tree tab from outside the panel. |
| `Core::set_devtools_tab` | `kui_set_devtools_tab` | `set_devtools_tab` | `setDevtoolsTab` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Shows the panel's tab named — one of its own, in any case, or a declared one, as declared — from outside the panel, as the strip's click does; a hidden panel comes back docked. |
| `Core::devtools_current_tab` | `kui_devtools_current_tab` | `devtools_current_tab` | `devtoolsCurrentTab` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The tab the panel is on, by name. |
| `Core::set_devtools_legend` | `kui_set_devtools_legend` | `set_devtools_legend` | `setDevtoolsLegend` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The key legend the panel's facts tab shows. |
| `Core::set_inspect` | `kui_set_inspect` | `set_inspect` | `setInspect` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Turns the per-frame node snapshot behind `nodes` on. |
| `Core::nodes` | `kui_nodes` | `nodes` | `nodes` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The last frame's nodes with what layout and the declarations made of them — a tree view's and an inspector's data. |
| `Ui::span` | *none: no closure crosses kui.h: `kui_span_begin` before the work and `kui_span_end` after it* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | `span` | `span` | Runs a function inside a span of that name, on the timeline the Perf tab and a trace file show, and returns what it returned. |
| `Core::span_begin` | `kui_span_begin` | `span_begin` | `spanBegin` | `env.span(name, fn)`, the closure form | Begins a span inside the one open now, recording the node the builder has open; its id, 0 while nothing is recorded. A span left open when its frame ends is closed there and marked cut. |
| `Core::span_end` | `kui_span_end` | `span_end` | `spanEnd` | `env.span(name, fn)` ends it as `fn` returns or throws | Ends the span an id names, and any opened inside it and left open; 0, or an id with no begin, is nothing. |
| `Core::perf_measure` | `kui_perf_measure` | `perf_measure` | `perfMeasure` | `perf_measure` | A span timed elsewhere — a parse on another thread, a job — of so many ms, ending now, on the track named for it. |
| `Core::perf_count` | `kui_perf_count` | `perf_count` | `perfCount` | `perf_count` | Adds to this frame's counter of that name. |
| `Core::perf_gauge` | `kui_perf_gauge` | `perf_gauge` | `perfGauge` | `perf_gauge` | Sets a reading — a footprint, a buffer's bytes — held until set again. |
| `Core::perf_mark` | `kui_perf_mark` | `perf_mark` | `perfMark` | `perf_mark` | Puts an instant on the timeline: a file opened, a command run. |
| `Core::perf_note` | `kui_perf_note` | `perf_note` | `perfNote` | `perf_note` | Puts a line on the timeline — what the numbers beside it cannot say, "editor moved, reads fs.stat" — shown in its frame's detail; at most 64 a frame and its gap, of 512 bytes each. |
| `perf::span_begin` | `kui_thread_span_begin` | `thread_span_begin` | `kui.threadSpanBegin` | *none: a script runs inside the host's call with its env at hand: `env.span(name, fn)` nests where it runs, and the host's own Rust times its calls into the script with `perf::span`* | Begins a span where no core is at hand — inside a script runtime, a library deep in a stack — on the recording of the core whose span is open on this thread, nested in the span open now, under its origin and node; 0 while none is. |
| `perf::span_end` | `kui_thread_span_end` | `thread_span_end` | `kui.threadSpanEnd` | *none: a script runs inside the host's call with its env at hand: `env.span(name, fn)` nests where it runs, and the host's own Rust times its calls into the script with `perf::span`* | Ends the thread span an id names, and any opened inside it and left open; one still open when the core's last span closes is closed there and marked cut. |
| `perf::span` | *none: no guard crosses kui.h: `kui_thread_span_begin` before the work and `kui_thread_span_end` after it* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | *none: a JS value has no drop to end it on: `threadSpanBegin` before the work and `threadSpanEnd` after it* | *none: a script runs inside the host's call with its env at hand: `env.span(name, fn)` nests where it runs, and the host's own Rust times its calls into the script with `perf::span`* | A thread span that ends when the guard it returns drops. |
| `Core::perf_measuring` | `kui_perf_measuring` | `perf_measuring` | `perfMeasuring` | `perf_measuring` | Whether anything is recorded — the Perf tab recording or on show, `KUI_PERF_TRACE`, a `tracing` subscriber — so an app skips reading clocks of its own for the recording's doors. |
| `Ui::request_frame_for` | `kui_request_frame_for` | `request_frame_for` | `requestFrameFor` | `request_frame_for` | Asks for a frame and names why: `owed_by` lists it under the name, and a recording's causes read `request: why`. |
| `Core::note_wake` | `kui_note_wake` | `note_wake` | `noteWake` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | A wake by name reached the window: the next frame's causes read `wake: name`. For a host whose own thread or loop woke it. |
| `Waker::named` | `kui_waker` hands out the runner's waker under `kui_run`, which `kui_waker_wake_named` wakes by name; `kui_waker_wake`, `kui_waker_wake_at`, `kui_waker_clone` and `kui_waker_free` beside it | `waker` and `waker_wake_named`, with `waker_wake`, `waker_wake_at`, `waker_clone` and `waker_free` | *none: libuv is the addon's timer (D4): a completion runs on the loop between pumps, and `noteWake` names it there* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | A waker whose wakes carry a name, read `wake: name` among the next frame's causes; any thread may hold one. |
| `Core::set_perf_recording` | `kui_set_perf_recording` | `set_perf_recording` | `setPerfRecording` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Starts a recording, dropping what was kept, or stops one and keeps it — the Perf tab's record button. |
| `Core::perf_recording` | `kui_perf_recording` | `perf_recording` | `perfRecording` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether a recording runs. |
| `Core::perf_trace` | `kui_perf_trace` | `perf_trace` | `perfTrace` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | What is kept — the last recording, or the frames the Perf tab shows — as `kui-trace` bytes, a `.kuitrace` file's. |
| `Core::perf_flush` | `kui_perf_flush` | `perf_flush` | `perfFlush` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Writes out what the file `KUI_PERF_TRACE` names holds so far. |
| `Ui::add_extension` | `kui_ctx_add_extension` | `ctx_add_extension` | `Ctx.addExtension` | `add_extension` | Loads a plugin under a namespace; a `KuiWindow` takes its list at construction (`extensions`). |
| `Ui::component` | `kui_component` | `component` | `<component name props groups fresh>children</component>` | `component(name, props, children)` | Places a component an extension provides — `ns/root` is an extension's view — keyed by where it is or by `key` in its props (a string by name, an integer by data index as `open_indexed`, so a list's rows keep their instances as it shifts): its fill reads the props, its events arrive as the messages in its `on*` props, the host's children are built where it asks, and an unchanged instance is replayed without the extension (ADR 0060, ADR 0067). |
| `Ui::memo` | `kui_memo` | `memo` | *none: a JSX frame is encoded whole before the core sees it, so the core cannot answer `replayed` before the function would run; backlog F285 leaves it* | `memo(key, deps, function() return … end)` | A part of the view built once and pushed again while `deps` hold (backlog F285): the function runs on the first frame, and after it only when `deps` differ or a fact of the frame it read moved (a hover it asked about, a scroll, the theme); otherwise what it built is pushed again without calling it, on the journal a component instance replays by. Keyed by a label, or a data index (`memo_indexed`, `kui_memo_indexed`, an integer key in Lua); its nodes are the view's own, their events and labels too; a memo inside a memo is kept on its own. `try_memo` keeps nothing when the body fails. |
| `Ui::lazy` | `kui_lazy` | `lazy` | `<Lazy needs={{ w, h }} render={() => …} fallback={() => …} />` | a child table `{ needs = { w =, h = }, render = function() … end, fallback = … }` | A branch built only when its parent offers the room it needs, laid out at exactly that size, with a fallback otherwise (ADR 0069): decided from the last layout's room, the frame built once more when this one's says otherwise, replayed with the component instance it is in while its decision holds. |
| `Ui::lazy_query` | `kui_lazy` with a `query` map of conditions | `lazy` with a `query` map of conditions | `<Lazy query={{ width: { below: 700 } }} render={…} fallback={…} />` | a child table `{ query = { width = { below = 700 } }, render =, fallback = }` | A branch built while a query holds over its parent's size, the window's or the environment's (ADR 0069); a state condition in it is refused (`query-state`). |
| `Core::rerun_owed` | `kui_rerun_owed` | `rerun_owed` | `rerunOwed` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Whether a lazy branch's decision disagreed with the frame just laid out (ADR 0069): a host driving its own loop builds the frame once more before drawing it. The runners do it themselves. |
| `Core::hosted_lazy_choices` | *none: `kui_lazy` decides as it opens the branch, inside the build* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | `lazyChoices` | *none: a script's lazy table is decided as its view is lowered, inside the build* | What the last layout decided for each lazy branch a binding decided itself (`Core::lazy_open_as`), in build order: what a Node view, encoded before the frame can be asked, reads its next choices from (ADR 0069). |
| `Ui::slot` | `kui_slot` | `slot` | `<slot name props/>` | `slot(name, props)` | A contribution slot: places every component the loaded extensions contribute to `name` (`Extension::contributions`, Lua's `contributes`, C's `kui_ext_contributions`) as siblings here, in load order and then `order`, each with the slot's props and its events the host's messages with `from` naming the provider; answers how many where the binding can (ADR 0067). |
| `Ui::children` | `kui_children` | `children` | *none: a Node host places components; it fills none* | `children(group)` in a component's function | In a component's fill: builds the host's children of a group here, under the host's origin, keyed by the instance and the group, their events the host's (ADR 0060). |
| `slot::emit` | `kui_emit` | `emit` | *none: a Node host hears component events; it raises none* | `emit(prop, fields)` returned from `on_event` | An extension's answer to an event that raises one of its component's events: the host hears the message it passed for that prop, about the instance (ADR 0060). |
| `Channel::table` | `kui_channel_new`, `kui_channel_add_f64` / `_i64` / `_str`, then `kui_channel_finish` | `channel_new`, `channel_add_f64` / `_i64` / `_str`, then `channel_finish` | `new Channel({ … })` | `channel { name = {…}, … }` | Makes a channel (ADR 0065): named columns of one length the core owns, read by row and column wherever its handle goes — a component's props, a message, another thread. |
| `Channel::reduce` | `kui_channel_reduce` | `channel_reduce` | `channel.reduce(col, from, to, buckets)`, a typed array per field | `ch:reduce(col, from, to, n)`, a list per field | Buckets a number column's rows `from` up to `to` into at most `n`, each one's least, greatest, first and last value and their rows (backlog C95): a chart's pixel columns of a hundred thousand rows without the rows crossing into the binding. |
| `Channel::append` | `kui_channel_append` | `channel_append` | `channel.append(columns, cap)` | `ch:append(columns, cap)` | The next revision with more rows after this one's, the oldest past `cap` dropped (backlog C147): this revision's rows are shared with the next, so a growing log costs its new lines. |
| `Channel::filter` | `kui_channel_filter_f64` (a range, `min == max` for one value) and `kui_channel_filter_str` (equal, contains, contains in any case) | `channel_filter_f64` and `channel_filter_str` | `channel.filter(col, { eq \| contains, caseSensitive \| min, max }, rows)`, a `Uint32Array` | `ch:filter(col, { eq \| contains, case \| min, max }, rows)`, a list | The rows — all, or a given list's — whose cell in a column is a value, holds a string or lies in a range (backlog C148): a view built in Rust, not in the binding. |
| `Channel::sort` | `kui_channel_sort` | `channel_sort` | `channel.sort(col, descending, rows)`, a `Uint32Array` | `ch:sort(col, descending, rows)`, a list | The rows — all, or a given list's — ordered by a column, ties in order and NaN last (backlog C148). |
| `Channel::take` | `kui_channel_take` | `channel_take` | `channel.take(rows)` | `ch:take(rows)` | A new channel of the rows given, in that order (backlog C148): a filtered or sorted view to hand a component. |
| `Channel::lanes` | `kui_channel_lanes`, read with `kui_channel_lanes_window`, `_count` and `_extent` | `channel_lanes`, read with `channel_lanes_window`, `_count` and `_extent` | `channel.lanes(start, len, lane)`, read with `lanes.window(lane, v0, v1, min)` | `ch:lanes(start, len, lane)`, read with `lanes:window(lane, v0, v1, min)` | A channel's intervals on lanes, built once in Rust, read a window at a time at a level of detail — about a run a pixel, whatever the rows behind them (ADR 0075): what a waterfall draws a million spans as. |
| `Launcher::extensions` | `kui_ctx_extension_count` / `kui_ctx_extension_namespace`, one at a time | `ctx_extension_count` / `ctx_extension_namespace`, one at a time | `Ctx.extensionNamespaces` | `extension_namespaces` | The namespaces loaded. |
| `Core::frame` | `kui_frame_begin` … `kui_frame_finish` | `frame_begin` … `frame_finish`, or `kui.frame` around a view | `Ctx.frame` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Runs one frame: the view, layout, the draw list; `KuiWindow.setView` is the windowed form, the runner calling it. |
| `Core::output` | `kui_draw_data` | `draw_data` | `quads` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The draw list: quads, clips, fragment and texture draws (`clips`, `fragmentDraws`, `textureDraws` beside `quads` in Node) and the frame's stats. |
| `Core::take_pending_events` | `kui_poll_event` | `poll_event` | `pollEvents` | `on_event(ev)`, pushed after each frame | What the frame and the input since produced, for `update`. |
| `Core::set_time` | `kui_set_time` | `set_time` | `Ctx.setTime` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The clock the tweens read; a window's runner sets it from the display. |
| `Ui::exit_with` | `kui_exit_with` | `exit_with` | `exitWith` | `exit_with` | Names the exit a node leaves by if this frame stops declaring it, over the one it declared: a throw a button aims. |
| `Ui::request_frame_at` | `kui_request_frame_at` | `request_frame_at` | `requestFrameAt` | `request_frame_at` | Asks for a frame at a time on the frame clock — a toast's expiry, a sequence's beat — with nothing owed until then. |
| `Core::next_frame_at` | `kui_next_frame_at` | `next_frame_at` | `nextFrameAt` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The time a driver should next draw at for a frame asked at a time; infinity in C and Odin, null in Node, for none. |
| `Ui::now` | `kui_now` | `now` | `now` | `env.now`, a reading | The frame clock in seconds, the one the tweens read: what a view times its own deadlines by. |
| `Ui::scale` | `kui_scale` | `scale` | `env().viewport.scale`, a reading | `env.scale`, a reading | The display scale factor of the window being built, device pixels per logical px (backlog C127): what a view lands an edge on a whole physical pixel by, a whole logical px being one at integer scales only. |
| `Core::env` | `kui_env_set` and its four siblings, `ENV_FIELDS`' C column | `env_set` and its four siblings | `Ctx.setEnv` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The host facts written in (the `env` field); a `KuiWindow`'s runner writes its own. |
| `Ui::env` | *none: C is the host, so it writes the facts and has no reading (`ENV_FIELDS`)* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | `env` | `env`, the view's argument | The facts read back, `ENV_FIELDS` row for row. |
| `Core::handle_input` | `kui_input_cursor` … `kui_input_access`, one per `InputEvent` | `input_cursor` … `input_access`, one per input event; `click` and `press` for a drive | `Ctx.cursor` … `Ctx.access`, one per `InputEvent`; a `KuiWindow` refuses injection | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Pointer, wheel, key, text, IME, assistive and OS file-drag input; a wheel gesture's latching is `scroll_gesture` (`kui_input_scroll_gesture`, `Ctx.scrollGesture`, backlog F107), and a wheel's notches, which glide, are `InputEvent::Wheel` in lines (`kui_input_wheel`, `Ctx.wheel`, ADR 0050); a trackpad's pinch, heard by an `onScroll` node as `zoom`, is `InputEvent::Pinch` (`kui_input_pinch`, `Ctx.pinch`, backlog F256); `press` / `release` are a click by label (`kui_input_press`, `Ctx.press`); the file drag is `drag_files` / `drop_files` / `drag_cancel` (ADR 0031); a file dialog's answer is `answer_files` (`kui_input_files`, `Ctx.answerFiles`, backlog C51); the documents the OS asked the app to open are `InputEvent::Open` (`kui_input_open`, `Ctx.openDocuments`, backlog F124). |
| `Core::modifiers` | `kui_input_modifiers` | `input_modifiers` | `Ctx.modifiers` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The modifier state, reported on its own when the OS does (backlog AR22). |
| `Core::release_held_keys` | `kui_release_held_keys` | `release_held_keys` | `Ctx.setEnv({focused: false})` releases, as losing the keyboard does for every driver (ADR 0020) | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Lets go of every key the focused sink holds. |
| `Core::set_subpixel_text` | `kui_set_subpixel_text` | `set_subpixel_text` | *none: a Node host never paints: the renderer behind `KuiWindow` is the runner's, and a headless `Ctx` has none* | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | LCD subpixel coverage for outline glyphs, for a renderer that blends per channel. |
| `Core::set_opacity_groups` | `kui_set_opacity_groups` | `set_opacity_groups` | `setOpacityGroups` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | A faded subtree drawn as one picture, faded once (ADR 0056): its quads between group markers, unfaded by it. The runner turns it on for its windows; a headless driver turns it on to capture what a window shows, and a host drawing the quads itself once it draws groups. |
| `Core::set_paint_audit` | *none: a test aid with no door of its own: `KUI_PAINT_AUDIT=1` turns it on under kui-native's driver, and what it finds arrives as `paint-escape` warnings, which a C host already reads* | *none: Odin's doors are kui.h's (packages/odin): C has none, for the reason in C's cell* | `KUI_PAINT_AUDIT=1` in the environment: a window is kui-native's driver, and what the audit finds arrives as `paint-escape` warnings | `KUI_PAINT_AUDIT=1` in the environment of `kui run` (any kui-native driver): `paint-escape` warnings, and a headless run prints the counts at its end | The paint audit (ADR 0074): every frame's quads, glyphs and masks checked against the clip of the nearest box above their node that clips or scrolls, by what the node declares; one drawn outside raises `paint-escape`. `Core::paint_audit` reads the counts. A test aid, off by default. |
| `Core::take_audio_commands` | `kui_take_audio_commands` | `take_audio_commands` | `Ctx.audioCommands` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Drains what the frame asked of the audio device; a `KuiWindow`'s device is the runner's. |
| `Core::audio_ended` | `kui_audio_ended` | `audio_ended` | `Ctx.audioEnded` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The device reports a playback over. |
| `Core::audio_truncated` | `kui_audio_truncated` | `audio_truncated` | `Ctx.audioTruncated` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The device reports a stop that cut a playback short — a one-shot node's removal becomes `truncated-playback`. |
| `Core::audio_refused` | `kui_audio_refused` | `audio_refused` | `Ctx.audioRefused` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The device reports a play it would not take — a `refused` sound event and `playback-refused`. |
| `Launcher::size` | `width` / `height` in the `KuiRunConfig` `kui_run_with` takes | `width` / `height` in the `Run_Config` `kui.run` takes | `width` / `height` in `WindowOptions` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The window's opening size; `min_size` / `max_size` / `chrome` / `text_aa` / `diagnostics` / `frame_latency` / `backdrop` are the rest of the set, and each binding's form carries them all (`min_w`, `chrome`, `text_aa`, `diagnostics`, `frame_latency`, `backdrop` in C and Odin; `minWidth`, `chrome`, `textAa`, `diagnostics`, `frameLatency`, `backdrop` in Node). `Launcher::devtools` and `Launcher::core` are the two the others reach another way: `kui_set_devtools` / `setDevtools` on the context, and the context handed to `kui_run_with` *is* the core. |
| `Launcher::icon` | `kui_set_icon` | `set_icon` | `icon` in `WindowOptions` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The icon every window of the app is created with — RGBA pixels and their size — shown by Windows in the title bar, Alt-Tab and the taskbar and by X11's window manager (backlog F86), and on macOS, where a window has none, as the app's in the Dock and ⌘Tab while it runs, unless the app is a bundle whose `Info.plist` names an icon (backlog F181); Wayland's is the `.desktop` file's. `Launcher::icon_resource` is the Windows executable's own icon resource, which wins there — C's `resource` argument, Node's `icon.resource`. C's is a free function called before `kui_run`, for `kui_on_teardown`'s reason. |
| `Launcher::app_id` | `kui_set_app_id` | `set_app_id` | `appId` in `WindowOptions` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The name the Linux desktop knows every window of the app by — the Wayland `app_id` and both halves of the X11 `WM_CLASS` — matched to the app's `.desktop` file, whose `Icon=` is then the window's (backlog F172). Nothing on Windows or macOS. C's is a free function called before `kui_run`, as `kui_set_icon` is. |
| `Launcher::icon_bytes` | `kui_decode_image`, then `kui_set_icon` | `decode_image`, then `set_icon` | `kui.decodeImage`, then `icon` in `WindowOptions` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The icon from an image file's bytes, a PNG most often, through the runner's decoder. |
| `kui_native::decode_image` | `kui_decode_image` | `decode_image` | `kui.decodeImage` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | PNG, JPEG, WebP or GIF bytes to straight RGBA with the runner's decoder, the shape `add_image` takes; C's frees with `kui_pixels_free`. |
| `kui_native::decode_animation` | `kui_decode_animation` | `decode_animation` | `kui.decodeAnimation` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Every frame of an animated GIF, APNG or WebP, each the whole canvas, with the seconds each shows and the loop count. |
| `Animation::at` | `kui_animation_at` | `animation_at` | `kui.animationAt` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Which frame of an animation a moment shows and when the next is due: what `update_image` and `request_frame_at` take to play a GIF on the frame clock. |
| `kui_native::capture` | `kui_capture` | `capture` | `capture` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The last finished frame as pixels (backlog C55): drawn again from the core's draw list on a GPU device of the process's own, with no window, and read back as straight RGBA in physical px over the theme's `bg` — a window's core or a headless one alike, between frames. What a window shows, less what the OS draws behind a translucent one. C's frees with `kui_pixels_free`. |
| `kui_native::encode_image` | `kui_encode_image` | `encode_image` | `kui.encodeImage` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Straight RGBA as a file's bytes with the runner's encoders: PNG (lossless, fast), JPEG (a quality; alpha dropped), WebP (lossless) or GIF (256 colours) — a capture or a decoded image kept as a file by a test or a probe with no encoder of its own (ADR 0054). C's frees with `kui_pixels_free`. |
| `kui_native::open_recording` | `kui_open_recording` | `open_recording` | `kui.openRecording` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Opens a recording in kui-perf, the trace inspector — `kui perf <path>` with the runner's kui, else the one on `PATH` — and returns once it has started (backlog F253): what a host applies the devtools' `OpenRecording` menu action with, showing the file in its folder should it fail. |
| `kui_native::show_in_folder` | `kui_show_in_folder` | `show_in_folder` | `kui.showInFolder` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Shows a file or folder in the system's file manager — selected in Finder or Explorer, its folder opened elsewhere — and returns once it has started (backlog F203): "Show in folder" beside a file the app saved, and what a host applies the devtools' `ShowInFolder` menu action with. Fails, naming why, for a path that does not exist. |
| `kui_native::open_external` | `kui_open_external` | `open_external` | `kui.openExternal` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Opens a file, a folder or a URL (`https:`, `mailto:`, …) with what the system opens it with, and returns once that has started (backlog F203): a saved report in its app, a link in the browser. Fails, naming why, for a path that does not exist. |
| `AnimationEncoder::new` | `kui_animation_encoder_new` | `animation_encoder_new` | `kui.AnimationEncoder` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | An animated PNG or GIF written a frame at a time, played a number of times or for ever: a recording of captures. It keeps the rectangle each frame changed, folds a frame that changed nothing into the time of the one before, and gives a frame too short for the format (1 ms for PNG, 20 ms for GIF) to the next. C's `kui_animation_encoder_free` drops one unwritten. |
| `AnimationEncoder::add` | `kui_animation_encoder_add` | `animation_encoder_add` | `add` on a `kui.AnimationEncoder` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | A frame — the whole canvas, straight RGBA — and the seconds it shows. |
| `AnimationEncoder::finish` | `kui_animation_encoder_finish` | `animation_encoder_finish` | `finish` on a `kui.AnimationEncoder` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The file's bytes; the encoder is spent. C's frees with `kui_pixels_free`. |
| `Core::capture_to` | `kui_capture_to` | `capture_to` | `captureTo` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Asks for the next frame the window draws, written to a path as a picture — `.png`, `.jpg`, `.webp` or `.gif` by the extension — and answered with a `capture` event in the message it names, the path in it and not the pixels (ADR 0055): a screenshot row or a bug report's attachment. The runner serves it after the frame is drawn, in every binding; a headless driver with `Captures::serve`. From a view, the frame that view builds. |
| `Core::capture_to_clipboard` | `kui_capture_to_clipboard` | `capture_to_clipboard` | `captureToClipboard` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Asks for the next frame the window draws, put on the clipboard as a picture — "Copy screenshot" — and answered as `capture_to` is, with an empty path (ADR 0055). |
| `Core::record_to` | `kui_record_to` | `record_to` | `recordTo` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Asks for every frame the window draws from the next one on, written to a path as an animated PNG (`.png` / `.apng`) or GIF when the recording stops, each frame shown until the next on the frame clock; answered as `capture_to` is, with the frames and seconds (ADR 0055). One at a time per window. |
| `Core::stop_recording` | `kui_stop_recording` | `stop_recording` | `stopRecording` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Ends the window's recording with the next frame drawn, which it leaves out, and has its file written (ADR 0055). |
| `Core::take_capture_commands` | `kui_serve_captures`, which drains the queue and serves it | `serve_captures`, which drains the queue and serves it | `Ctx.serveCaptures()`, which drains the queue and serves it | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | Drains the captures and recordings asked for since the last drain, as data (ADR 0013): what a headless Rust test asserts a button asked for, with no GPU and no file. |
| `Captures::serve` | `kui_serve_captures` | `serve_captures` | `Ctx.serveCaptures` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | A headless driver's turn after a frame (ADR 0055): the core's capture commands served against the frame it finished — stills written, the recording fed or finished — and a `capture` event pending for each that named a message. The runner keeps one per window and serves it after every frame drawn, so a window's app never calls it; C's does nothing for the context `kui_run`'s view is handed. |
| `App::teardown` | `kui_on_teardown` | the `teardown` procedure `kui.run` takes | `KuiWindow.onTeardown` | *none: a script is a guest in the host's frame (ADR 0067): its env is the view's reading, and registering, driving, pacing and reading back are the host's* | The window going for good — its close button, Quit from the menu or the dock, a close command on it, a pumped runner ended — heard once, before `run` returns or the process exits, with nothing drawing: the place to keep what the app would lose with the window (backlog F74, the other two hosts under RG1). On macOS a Quit ends the process from inside the loop, so this is the only thing an app runs on ⌘Q — nothing after `run`, `kui_run` or `await runWindowed(...)` does, not even `process.on('exit')`. C's is a free function called before `kui_run`, with the run's `user`, since `kui_run`'s app is three arguments and not a struct. Node's is the window's door, called from inside the pump that saw the window go; `runWindowed` registers its config's `teardown(model)` there, and `createApp`'s `app.teardown()` runs the same one for a headless drive. |
