UI
Gamma's UI system is meant to be close to what HTML, CSS and JavaScript give a web page, with a Luau API instead of markup and a DOM, and running natively inside the engine. The same system builds a game HUD, a settings screen, a node-graph tool, a text editor or a whole desktop app.
This page is the design. Each part is built in the order given in the plan; what exists today is marked in the capability table.
Principles
- Few primitives, rich styling. The engine provides a small set of node types. Buttons, sliders, tabs, menus, lists and dialogs are compositions of those nodes, written in Luau and shipped as Gamma's widget library, so a program can restyle or replace any of them.
- Web semantics where they exist. Layout, the box model, the cascade, events and animations follow CSS and DOM behaviour, with CSS's property names in Upper Camel Case (
JustifyContent,BorderRadius,FlexGrow). Someone who knows the web should be able to guess a property, and its behaviour should not surprise them. - Reactive by default. State is part of the system, not a package. A node property can be bound to state, and the node updates when the state changes.
- Not tied to a screen. A UI tree is drawn on a surface: a window, an overlay on a 3D scene, a panel in the 3D world, or a texture.
- Fast enough for tools. Thousands of nodes, long virtualised lists and per-frame updates have to stay smooth. Layout, style and paint are only recomputed for what changed.
Nodes
Every UI node is an object in the tree, with properties, events and children like every other object, so it can be found, inspected, saved and scripted the same way.
| Node | Web equivalent | Purpose |
|---|---|---|
View | <div> | A box. Holds children, takes the whole box model and layout. |
Text | text, <span>, <p> | Text, including inline spans with their own style and inline child nodes. |
Image | <img> | An image or texture, with ObjectFit and nine-slice. |
TextInput | <input>, <textarea> | Editable single or multi-line text with selection, clipboard, undo and IME. |
Terminal | xterm.js | A text terminal for a program on a serial port, socket or pipe. |
World2D | <canvas> with a game loop | A 2D world of sprites and tile maps seen through a camera. See 2D games. |
ScrollView | overflow: auto | A View that scrolls its content, with momentum and scroll bars. |
Canvas | <canvas> | Draws with a Luau callback through a 2D vector API (paths, fills, strokes, text, images). |
Viewport | WebGL canvas | Shows a 3D scene from a camera. |
Surface | the document | The root of a UI tree, bound to a window, an overlay, a world panel or a texture. |
Every node except Surface takes the full style. ScrollView is a View whose Overflow defaults to Scroll, kept as its own node so its scroll position, events and virtualisation have a clear home.
Form controls (Button, Checkbox, Radio, Switch, Slider, Select, NumberInput, ColorPicker), menus, tooltips, dialogs, tabs, tables, trees and virtualised lists are widgets in the Luau library, built on these nodes.
Surfaces
- Window: a native OS window. A program can open several, each with its own title, size, DPI and surface.
- Overlay: drawn over a 3D scene in a window, as a game HUD.
- World: a surface placed in the 3D scene, facing a direction or the camera, receiving pointer input through raycasts.
- Texture: rendered offscreen, for thumbnails, effects or use as a material.
Units on a surface are device-independent pixels. The surface's scale factor (from the OS DPI, or set by the program) maps them to physical pixels, so text and borders stay sharp.
Layout
Layout follows CSS:
- Box model:
Width,Height,MinWidth,MaxWidth,MinHeight,MaxHeight,Margin,Padding,BorderWidth,BoxSizing(BorderBoxby default, unlike CSS) andAspectRatio. - Display:
Flex(the default, as in React Native, withFlexDirection = Column),Grid,Block-like flow for text, andNone. - Flexbox:
FlexDirection,FlexWrap,JustifyContent,AlignItems,AlignSelf,AlignContent,FlexGrow,FlexShrink,FlexBasis,Gap,RowGap,ColumnGap,Order. Implemented with Yoga. - Grid:
Display = GridwithGridTemplateColumns/Rows(lengths,fr,auto,minmax(),repeat()with a count,auto-fillorauto-fit),GridAutoColumns/Rowsfor implicit tracks,GridColumn/GridRowplacement ("2","-1","span 2","1 / 3","2 / span 2"),RowGap/ColumnGap, and CSS's sparse row-first auto-placement. Items without a size stretch to their cell; an item with a height is placed at the top of its cell, or byAlignSelf. A grid with an auto width that is not stretched (in a flex row, aligned rather than stretched in a column, absolutely placed or itself a grid item) takes the width of its columns at their max-content sizes, as CSS shrinks it to fit. Gamma's own, as Yoga has no grid: items are measured over a few layout passes and then placed absolutely. Named areas,JustifyItems/JustifySelf, column-first flow and dense packing come later. - Positioning:
Position = Relative | Absolute | Fixed | StickywithInset,Top,Right,Bottom,Left, andZIndexwith stacking contexts. - Overflow:
Visible,Hidden(clips),ScrollandAuto, per axis.
Lengths are written as strings, as in CSS, or as plain numbers of pixels, and read back as strings: "12px", "50%", "auto", "none", "1.5em", "1rem", "10vw", "10vh", and sums such as "100% - 24px" or "calc(1em + 2px)", with spaces around the operators as calc requires. Grid tracks also take "1fr". em is the node's FontSize, which defaults to "1em" (its parent's, so it inherits) and is 16px at the surface; rem is the surface's font size, and vw and vh are hundredths of the surface's size. A sum of a percentage and other units has to be resolved against the parent's size, so a layout that uses one runs a second pass.
Layout runs once per frame, only for subtrees whose layout inputs changed. A node's computed box is readable as node.LayoutRect (position relative to the surface and size, in pixels), and node.LayoutChanged fires when it moves or resizes, as ResizeObserver does.
Styling
Styles can be set three ways, in increasing priority (the cascade):
- Style sheets: rules with selectors, attached to a surface or a subtree.
- Inline styles: a node's
Styletable, or properties set directly on it. - Animations and transitions currently running on the property.
Selectors cover what most CSS uses:
- type (
View,Text), class (.primary, from a node'sClasses), id (#save, fromId),* - descendant (
A B), child (A > B), sibling (A + B,A ~ B) - states:
:hover,:active,:dragging,:drag-over,:focus,:focus-visible,:focus-within,:disabled,:checked,:selected,:empty - structure:
:first-child,:last-child,:nth-child(an+b),:not(...),:is(...),:where(...),:has(...) - attributes:
[Variant=ghost], from node attributes
Specificity and source order decide between matching rules as in CSS. Text properties (FontFamily, FontSize, FontWeight, Color, LineHeight, TextAlign and others) inherit from the parent; layout and paint properties do not. Inherit, Initial and Unset work as in CSS.
Variables: a property can read a custom property set on an ancestor with "var(--accent)", which is how themes work: a theme is a set of variables on the surface, swapped at run time.
Queries: rules can be wrapped in a media query (surface width and height, scale factor, prefers-color-scheme, prefers-reduced-motion) or a container query (an ancestor's size).
Style sheets are Luau tables:
local sheet = Ui.StyleSheet({
[".button"] = {
Padding = "8px 16px",
BorderRadius = 6,
Background = "var(--accent)",
Transition = "Background 120ms EaseOut",
},
[".button:hover"] = { Background = "var(--accent-hover)" },
["@media (max-width: 600px)"] = {
[".sidebar"] = { Display = "None" },
},
})or text files in a CSS-like syntax (*.gss), loaded with Ui.LoadStyleSheet(path) and reloaded when the file changes.
What exists today:
- A
StyleSheetstyles the UI nodes in its parent and below it, down to the nextSurface. Its rules are text inSource, which a place saves: selectors, thenName: value;declarations in braces,@mediablocks,@keyframesrules and/* */comments. A value is a quoted string, a number,trueorfalse, or else the text as written, soPadding: 8px 16px;andBackground: #3b82f6;need no quotes. A mistake throws an error naming its line.Ui.StyleSheet(table)writes a table like the one above as that text, in the order of its selectors' text, as a table has no order of its own (use text or a file where the order of two rules of equal specificity matters);Ui.StyleSheet(text)takes text, andUi.LoadStyleSheet(path)reads a.gssfile.Enabled = falseturns a sheet off. A sheet fromUi.LoadStyleSheethas itsSourceFileset, and reads the file again within half a second of it changing, so editing a.gssfile restyles a running game; a mistake in the new text keeps the old rules and logs a warning naming the line. - Selectors: types (any class, tested with
IsA),.class(fromClasses, a space separated list, withAddClass,RemoveClass,HasClassandToggleClass),#id(fromId),*,[Attribute]and[Attribute=value], the four combinators,:hover,:active(fromIsHoveredandIsPressed),:draggingand:drag-over(fromIsDraggingandIsDragOver),:focus,:focus-visible(the same as:focusfor now),:focus-within,:disabled,:checkedand:selected(true boolean attributesDisabled,CheckedandSelected),:empty,:first-child,:last-child,:nth-child(an+b)(withoddandeven),:not(),:is()and:where()(which adds no specificity) with compound selectors, and:has()with relative selectors (.card:has(> Image),.field:has(:focus),.item:has(+ .item)), whose specificity is its most specific argument's. Specificity and order decide as in CSS, and a sheet further down the tree comes after one above it. - A property set on the node itself, by a script, a place or a tween, wins over every sheet from then on. Until then the node keeps its own value, which comes back when no rule sets the property any more and which a place saves in place of the styled one.
var(--name)andvar(--name, fallback)read custom properties, set by--name: value;declarations or by attributes named--name(surface:SetAttribute("--accent", "#3b82f6")), and inherited down the tree, so a theme is a set of attributes on the surface. A property whose variable has no value and no fallback keeps the node's own value.inherit,initialandunsetwork as in CSS.@mediatakesmin-width,max-width,min-height,max-height(the surface's size, in pixels),orientation,prefers-color-scheme(Gamma reportslight) andprefers-reduced-motion(no-preference), joined withand, with commas between alternatives.- Styles apply at the start of a surface's layout, so a script reading a styled property right after changing a class sees the old value until the next frame or
Layout. A change to a node's classes,Id, attributes or state (hover, press, focus, dragging) restyles only that node and its descendants, with the sheets and variables above it; adding, removing or moving nodes, a changed sheet, any such change while a sheet uses:has(),+or~, and a change of focus while one uses:focus-within, restyle the whole surface.Surface:GetRestyledNodeCount()in C++ says how many nodes the last restyle visited.
Paint
- Background: colours (
"#rrggbbaa","rgb()","hsl()","oklch()",Colorvalues), linear, radial and conic gradients, images with size/position/repeat, several layers. - Borders: width, colour and style per side,
BorderRadiusper corner (elliptical radii later),OutlineandOutlineOffset. - Effects:
BoxShadow(several, inset),Opacity,Filter(blur,brightness,contrast,grayscale,drop-shadow),BackdropFilter,MixBlendMode. - Transforms:
Transform(translate,scale,rotate,skew, matrices) andTransformOrigin, applied after layout as in CSS. Hit testing follows them. - Clipping: by overflow, by
BorderRadius, and byClipPathlater. - Cursor:
Cursorper node.
Gamma draws the UI with its own renderer on bgfx: rounded rects, borders and shadows as signed-distance shapes in one batched pass, glyphs from a texture atlas, and offscreen passes only for filters and opacity groups. It does not go through ImGui or a browser engine.
What is drawn today:
BackgroundandBorderColortake"#rgb","#rgba","#rrggbb","#rrggbbaa","rgb()"/"rgba()","hsl()"/"hsla()"(with commas or spaces and an optional/ alpha),"transparent", basic named colours, or aColor, and read back as written.Backgrounddefaults to transparent andBorderColorto black (CSS'scurrentColorcomes with theColorproperty).Backgroundalso takes a gradient:"linear-gradient(to right, #fff, #000)"(an angle such as45deg, ortoa side or corner, defaulting toto bottom),"radial-gradient(circle at top left, white, black)"(circleorellipse,closest-side,closest-corner,farthest-sideorfarthest-corner, or radii, andata position) and"conic-gradient(from 90deg at 50% 50%, red, yellow, red)". Colour stops take one or two positions as percentages or lengths (angles or percentages around a conic gradient), and stops without one are spaced evenly, as in CSS. A lone position between two stops is a colour hint, where their colours mix half and half ("linear-gradient(red, 20%, blue)"). Several layers go in oneBackgroundseparated by commas, the first on top, with a colour under them all that may only come last:"linear-gradient(#ffffff40, #fff0), linear-gradient(to right, red, blue), white". Colours mix with premultiplied alpha, so fading to transparent does not go grey.repeating-linear-gradient(),repeating-radial-gradient()andrepeating-conic-gradient()repeat the colours from the first stop to the last, so"repeating-linear-gradient(45deg, #000 0 10px, #fff 10px 20px)"draws stripes. Each gradient (each period of a repeating one) is drawn from 256 samples, and a frame shows up to 256 different ones; past that they draw as their first colour.- Per-side solid borders from
BorderWidth(andBorderTopWidthand the other sides), andBorderRadiuswith one to four corners (BorderTopLeftRadiusand the others). A percentage in a radius refers to the box's smaller side, and radii too big for their side shrink together, as in CSS. BoxShadowtakes CSS's list of shadows, such as"0 2px 6px rgba(0, 0, 0, 0.3)"or"0 1px 2px black, 0 8px 24px #0004": offset x and y, then an optional blur radius and spread, in any unit but percentages, and a colour (the textColorwhen left out). The first shadow is on top. A spread grows the corner radii with the box, and the blur is a Gaussian across the nearest edge, so a small box with a large blur is a little stronger than in a browser. An outer shadow is also drawn under the box, so it shows through a translucentBackground.insetdraws a shadow inside the padding box instead, over the background and under the content, cast by the edge of a hole that is the padding box moved by the offset and shrunk by the spread ("inset 0 2px 4px #0003"). Hit testing ignores shadows.Opacityfrom 0 to 1 is multiplied down the tree. CSS fades a whole group at once, which matters where children overlap; that comes with the offscreen passes for filters.ZIndex(a whole number, default 0) sorts nodes within their stacking context. The surface, and every node with aZIndexother than 0 or anOpacitybelow 1, is a stacking context: it draws its own box, then the nodes in it byZIndex(negative ones behind the rest) and tree order, each nested context drawn whole.Transformtakes a CSS transform list:translate(x, y),translateX(),translateY(),scale(x, y),scaleX(),scaleY(),rotate(angle),skew(x, y),skewX(),skewY()andmatrix(a, b, c, d, e, f), with lengths in any unit (percentages of the node's own box) and angles indeg,rad,gradorturn, applied right to left, or"none". It moves the node and everything in it after layout, so other nodes keep their places, aboutTransformOrigin(default"50% 50%", its centre; it takes one or two lengths orleft,center,right,topandbottom). A positive angle turns clockwise, as y points down. A node with a transform is a stacking context, and hit testing and clicks into aTextInputfollow its transform. A clip seen through a rotation or a skew clips to its bounding box, so a turned node withOverflow = Hiddenclips less than CSS does.Overflow = Hiddenclips descendants to the node's padding box, as a rectangle; clipping to rounded corners comes later.Overflow = Scrollclips asHiddendoes and scrolls the content byScrollPosition(aVector2, kept between 0 and the content's size less the padding box's, so a script setting it too far gets the end).ScrollSizeis the content's size, padding included, as of the last layout. The mouse wheel scrolls the nearest scroll container under the pointer that can still move that way, about three lines a notch, and one at its end passes the wheel to the one around it. A thin bar over the right (and bottom) edge shows the position while the content overflows. Dragging the bar scrolls with it, and a press on the strip beside it pages toward the press, a padding box at a time, without the press doing anything else; momentum and touch scrolling come later.ScrollViewis aViewwhoseOverflowstarts asScroll. The children of a scroll container keep their size along the scroll axis rather than shrinking to fit it, as CSS'smin-height: autokeeps them; give the container itselfFlexBasis = 0(CSS'sflex: 1 1 0) to have it take only the space left in its parent.- A
SurfacewithTarget = Windowis laid out to the window's size every frame ofGamma playand drawn over the 3D scene, in tree order with other window surfaces. Units are window pixels until DPI scaling arrives.
Text
- Font loading from files and assets,
FontFamilylists with fallback, weights, italics, variable fonts later. - Shaping with HarfBuzz for ligatures, kerning and complex scripts, and bidirectional (right-to-left) text. The first step uses stb_truetype for simple Latin text.
- Wrapping (
WhiteSpace,WordBreak,OverflowWrap),TextOverflow = Ellipsis,LineClamp,TextAlign,LineHeight,LetterSpacing,TextDecoration,TextTransform,TextShadow. - Rich text: a
Textnode holds spans, each with its own style and events (links), and inline child nodes (an icon in a sentence). - Selection and copying on any text with
UserSelect = Text; full editing inTextInput, including IME composition from SDL. - Measurement:
Ui.MeasureText(text, style, maxWidth).
What exists today:
- A
Textnode with aTextstring. Layout measures it, so it takes the width of its text and wraps to fit the width it is given; its own UI children are not laid out. - Fonts: Gamma bundles Noto Sans (regular and bold, under the SIL Open Font License, in
Assets/Fonts), which is alsosans-serifand the fallback of every family list, followed by Noto Sans Symbols and Noto Sans Symbols 2 (also bundled, under the same licence) for arrows, dingbats and other symbols. Noto Sans Mono (regular and bold, also bundled) ismonospace, and has box drawing and block characters.Ui.LoadFont(family, path, weight?)adds a TrueType or OpenType file.FontFamilytakes a CSS list such as"Brand, Noto Sans, sans-serif", and each character uses the first font in the list that has it.FontWeighttakes 1 to 1000,"normal"or"bold", and picks each family's nearest weight; there is no synthetic bold or italic. Color,FontFamily,FontWeight,LineHeight,TextAlign(Left,Center,Right) andWhiteSpace(Normal,NoWrap) inherit, asFontSizedoes. Each reads"inherit"until it is set, and setting"inherit"unsets it.LineHeighttakes"normal"(the font's own spacing), a number (a multiple of the font size, which inherits as a multiple) or a length.TextOverflow = Ellipsisends a line too wide for its box with "…"; it is most useful withWhiteSpace = NoWrap. Lines break at"\n"and, when wrapping, at spaces; a word longer than its line stays whole.- Text is laid out with stb_truetype: advances and kerning only, so no ligatures, complex scripts or right-to-left text yet. Glyphs are rasterized at their size into a shared atlas and drawn on whole pixels. Unicode's default ignorable characters, such as variation selectors (the U+FE0F in "☀️") and zero width joiners, draw nothing rather than a missing glyph.
- Rich text: with
RichText = true, aTextnode reads itsTextas markup with HTML's inline tags, so runs of one paragraph can differ and still wrap together.<b>is bold,<u>underlines,<s>strikes through, and<font color="#e11d48" size="20" face="monospace" weight="600">sets any of a colour, a size in pixels, a font family and a weight; tags nest and close in order,<br>breaks the line, and<,>,&,",'and&#...;are characters. A tag it does not know, or one that is not closed in order, is shown as written. Each line is as tall as the tallest text on it, and every glyph on it shares one baseline, as CSS's line boxes do.DisplayTextreads the characters shown, and selection counts those.Ui.Text({ Spans = { "Score: ", { Text = "120", Bold = true, Color = "#16a34a" } } })writes the markup for you from a list of strings and tables (Text,Bold,Underline,Strikethrough,Coloras a string or aColor,Size,FontFamilyandFontWeight), escaping the text, and follows a state holding such a list;Ui.Markup(spans)returns the same markup. There is no italic yet, since there are no italic faces, and no links or inline nodes. UserSelect = Textlets the pointer select the characters ofTextnodes, as CSS'suser-selectdoes. It is inherited, so setting it on a surface or a panel makes all the text in it selectable, andNoneon a descendant turns it off again. Dragging across aTextnode selects from where the press was, Shift with a click extends the selection, a double click selects a word and a triple click a line. A surface has one selection, which a press anywhere else clears and Control+C (Command+C on macOS) copies to the system clipboard when the focused node does not take the key. It is drawn behind the glyphs in the node'sSelectionColor.text:GetCharacterAt(position)says which character, counted from 1 inDisplayText, is drawn at a point in the surface, or nil between characters, so a click can find a word or a link. From a script,text:Select(anchor, cursor)(caret positions from 1, soSelect(1, 6)selects the first five characters),text:ClearSelection(),text:GetSelectedText()andsurface:GetSelectedText(). Selection stays within one node for now, and new text clears it.- A
TextInputnode edits text, asinputandtextareado. It takes keyboard focus when clicked (a click puts the caret there, and dragging selects) and edits with the arrows, Home and End (with Shift selecting, and Control or Alt going by word), Backspace, Delete, and Control (Command on macOS) with A, C, X, V, Z and Y, through the system clipboard. Typed text comes through the OS, so keyboard layouts and input methods work: text an input method is composing shows underlined at the caret, and its candidates are placed by it. Its properties areText,Placeholder,PlaceholderColor,SelectionColor,MaxLength(0, the default, is no limit),MultiLine,CursorPositionandSelectionStart(character positions from 1, as Luau's strings count, andSelectionStart-1 for no selection). A single line input is about 20 characters wide until sized, centres its line in a taller box, scrolls sideways to keep the caret in view, turns line breaks into spaces and firesSubmitted(text)for Enter. AMultiLineone wraps at spaces (and within a word too long for a line), grows with its text and types Enter. Undo goes back through up to 100 edits, with a run of typing or deleting as one. - A
Terminalnode is a text terminal, as xterm is, for a program at the other end of a serial port, a socket or a pipe.terminal:Write(data)runs what the program sent, andInput(data)fires with what the terminal sends back: typed and pasted text, keys as xterm encodes them, and the answers to the program's queries (cursor position, device attributes,TERM). It understands what Linux programs send to anxterm-256colorterminal: cursor movement, erasing, scroll regions, the alternate screen, 16, 256 and 24-bit colours, bold, faint, italic, underline, inverse and strikethrough, wide characters, line drawing, bracketed paste, application cursor keys and window titles (itsTitleproperty). It is 80 by 24 cells until sized, fills the box it is given in themonospacefont unlessFontFamilysays otherwise, and its read-onlyColumnsandRowsfollow that box. It takes keyboard focus when clicked, and keeps Tab for the program. Dragging selects text; Control+C copies while there is a selection and interrupts otherwise (Control+Shift+C always copies), and Control+V or Control+Shift+V pastes. The mouse wheel and Shift+PageUp or Shift+PageDown scroll back through up toScrollbackLineslines (1000 by default), and on the alternate screen the wheel sends arrow keys instead. Its other members areScrollOffset,SelectionColor,Clear(),Paste(text),GetSelectedText(),GetLineText(row)(rows from 1) and theBellevent. There is no mouse reporting yet.
Images
What exists today:
- An
Imagenode with aSource: a file path (relative to the asset root) or anhttp://orhttps://URL. The image loads on a thread of its own, and nodes with the same source share it. PNG, JPEG, BMP, GIF, TGA and WebP are read. Animated GIFs and WebPs play and loop, all on one clock, with frames meant to last 10ms or less shown for 100ms as browsers do. - Until its own size is set, an
Imagetakes its image's size once it has loaded (0 by 0 before, or if it fails), and a size set on one side scales the other to keep the image's shape, as animgdoes. It is stretched over its content box (CSS's defaultobject-fit: fill) and is a leaf to layout, so its children are not drawn. ImageRendering = Pixelatedscales to the nearest pixel, for pixel art;Auto, the default, scales smoothly.ObjectFitfits the image to its content box as CSS'sobject-fitdoes, always centred:Fill(the default) stretches it,Containmakes it as large as fits whole,Coveras small as covers the box,Nonekeeps its own size, andScaleDownisNoneorContain, whichever is smaller. What falls outside the box is cut off.- Nine-slice:
SliceCenter, aRectin the image's pixels, marks its middle. The corners outside it keep their size (timesSliceScale, default 1) and the edges and middle stretch, as Roblox'sSliceCenterand CSS'sborder-imagedo, so one small image can frame a panel of any size. Corners too big for the box shrink together. An emptySliceCenter, the default, draws the image whole withObjectFit. - Rounded clipping and image backgrounds come later.
Events
Events follow the DOM model:
- Pointer:
PointerDown,PointerUp,PointerMove,PointerEnter,PointerLeave,Click,DoubleClick,ContextMenu,Wheel, for mouse, touch and pen alike, with pointer capture. - Keyboard:
KeyDown,KeyUp,TextInput, delivered to the focused node. - Focus:
Focus,Blur,FocusIn,FocusOut;TabIndexand arrow-key navigation, also driven by a gamepad. - Drag and drop:
DragStart,DragOver,Drop,DragEndwithin the program, and files dropped from the OS. - Clipboard:
Copy,Cut,Paste. - Lifecycle:
Mounted,Unmounted,LayoutChanged.
An event is a table with Target, CurrentTarget, position, buttons and modifiers. It travels through a capture phase from the surface down to the target and a bubble phase back up. Handlers can call event:StopPropagation() and event:PreventDefault() (to stop a TextInput inserting a key, for example). Hit testing honours transforms, clipping, PointerEvents = None and ZIndex. Input a UI handles is not passed on to the program's other input handlers, so clicking a HUD button does not also fire a weapon.
Shortcuts are Shortcut instances, scoped to a surface or a focused subtree (see below).
What exists today, for the mouse in Gamma play:
Clickfires for a primary button press and release, on the nearest node that was under both, then on each of its UI ancestors up to the surface, as a bubbling DOM event.PointerEnterandPointerLeavefire on a node when the pointer comes over it or a descendant and when it leaves them, without bubbling, outside in for entering and inside out for leaving.- Each of
PointerDown,PointerUp,PointerMove,Wheel,Click,DoubleClick,KeyDownandKeyUphas a capture form (PointerDownCapture,ClickCapture,KeyDownCaptureand so on) that fires first, from the surface down to the target, as DOM listeners added withcapture: truedo. The same event object then bubbles, andStopPropagationin a capture handler ends the whole dispatch, so a panel can keep presses or keys from everything inside it. ContextMenufires for a secondary (right) button press, on the node under the pointer and then up the tree, as the DOM'scontextmenu, and the press reachesInputwithgameProcessedEventset when something listened.DoubleClickfires after theClickof the second press in a run, bubbling the same way. Presses within half a second and 4 pixels of the one before make a run, andClickCounton thePointerEventofPointerDown,PointerUp,ClickandDoubleClicksays which press of the run it is: 1, 2 for a double click, 3 for a triple click (which can select a line), and 0 for a click the keyboard made.PointerDown,PointerUp,PointerMoveandWheelfire on the node under the pointer and bubble up the same way.PreventDefaultonPointerDownkeeps the press from moving focus or placing a caret, and onWheelkeeps it from scrolling.- Handlers get a
PointerEventwithTarget(the node under the pointer, or forClickthe nearest node under both press and release),CurrentTarget(the node whose handlers are running),Position,ClickCount, the modifier keys held at the time (Shift,Control,AltandMeta, booleans) and, forWheel,WheelDelta(notches, positive away from the user). One event passes up the tree, andevent:StopPropagation()stops it going further. node:CapturePointer(), usually called inPointerDown, sendsPointerMoveandPointerUpto that node wherever the pointer goes until the button is released, as for a dragged slider.ReleasePointerCapture()ends it early andHasPointerCapture()reads it.IsHoveredis true on the node under the pointer and its ancestors, andIsPressedon the pressed node and its ancestors until the release, as CSS's:hoverand:active. Both fire their property changed signals, so a style can follow them.- Drag and drop within the UI: a press on a node with
Draggable = true(or inside one) that moves more than 4 pixels firesDragStarton it, bubbling, where a handler can setevent.Data(any value an attribute can hold, copied) or callPreventDefaultto keep it a plain press. During the drag the pointer's other events stop, the dragged node hasIsDragging,DragEnterandDragLeavefire on nodes as the pointer comes over and leaves them (without bubbling, likePointerEnter), andDragOverbubbles from the node under the pointer each move. ADragOverhandler that callsPreventDefaultaccepts the drag, as on the web, and its node hasIsDragOveruntil the pointer leaves. Releasing over an accepting node firesDrop, bubbling from the node under the pointer; thenDragEndbubbles from the dragged node withDroppedsaying whether it landed. Every drag event hasDataandDragSource. A drag ends the press withoutPointerUporClick. Files dropped from the OS come later. PointerEvents = Nonelets the pointer through a node and everything in it to what is behind. It is inherited, as in CSS, so a descendant can setAutoagain, and a surface withNonelets clicks on its empty parts through to the game.- Hit testing follows the paint order (so
ZIndex) andOverflow = Hiddenclipping, and finds a node by its layout rect whether or not it draws anything. The pointer goes to the window surfaces as they were last laid out, and enter and leave also fire when the layout moves a node under a still pointer. - A press over a node with a
Click,DoubleClick,PointerDownorPointerUphandler, and the release that ends it, reachInputwithgameProcessedEventset, so clicking a button does not also act in the game. - Only the mouse's primary button clicks; the secondary button fires
ContextMenu.
Focus and the keyboard, in Gamma play:
- A node with a
TabIndexof 0 or more (aTextInputstarts at 0, everything else at -1) takes its surface's keyboard focus when pressed, and a press on anything else takes focus from whatever had it.node:Focus()andnode:Blur()do the same from a script,IsFocusedreads it, andFocusedandBlurredfire.node:ScrollIntoView()scrolls each scrolling ancestor as little as it takes to show the node, and Tab does it for the node it focuses. A node that leaves its surface or is hidden loses focus. - Keys go to the focused node of the topmost window surface that has one.
KeyDown(also for keys the OS repeats while held) andKeyUpfire on it and then bubble up, with aKeyEventholdingKeyCode,Shift,Control,Alt,Meta,Repeat,TargetandCurrentTarget.StopPropagationends the bubbling andPreventDefaultstops what the key would do. After the handlers, Tab and Shift+Tab move focus (positiveTabIndexvalues first, then 0 in tree order), the arrow keys move it to the nearest focusable node in their direction on a surface withSpatialNavigation = true(a node in the same row or column wins over a nearer diagonal one, and a widget that uses the arrows itself keeps them), Enter and Space click a focused node that is not aTextInput, and a focusedTextInputedits. - A
ShortcutfiresActivatedwhen itsKeys, such as"Ctrl+S","Ctrl+Shift+Z","Alt+Enter"or"Escape", are pressed with exactly those modifiers.Modmeans Cmd on macOS and Ctrl elsewhere, andEnabledturns it off. One parented to a surface is in scope whenever that surface gets keys, focused or not, and one parented to another node only while that node or a descendant has focus; the innermost match wins. It runs for a press that the focused node's handlers and default action did not use, never for a repeat, never while aTerminalhas focus, and while aTextInputhas focus only for chords with Ctrl, Alt or Meta.Ui.Shortcut({ Keys = "Ctrl+S", Activated = save })makes one. - Keys and wheel turns the UI uses reach
InputwithgameProcessedEventset, as clicks do, so typing in a field does not also move a character. With nothing focused, keys go to the game alone. Key repeats, typed text and input method text reach only the UI.
Reactivity
local count = Ui.State(0)
local label = Ui.Computed(function(use)
return `Clicked {use(count)} times`
end)
local view = Ui.View({
Classes = { "card" },
Children = {
Ui.Text({ Text = label }),
Widgets.Button({
Text = "Add",
Click = function()
count:Set(count:Get() + 1)
end,
}),
Ui.ForEach(items, function(item)
return Ui.Text({ Key = item.Id, Text = item.Name })
end),
},
})Ui.State(value)holds a value withGet,SetandChanged.Ui.Computed(fn)derives a value from the states ituses, and recomputes only when they change.- Any node property, style value or child list accepts a state or computed, and the node follows it. Bindings are released when the node is destroyed.
Ui.ForEach(list, fn)renders a keyed list, reusing nodes byKeyso their state, focus and animations survive reordering.Ui.Animated(state, transition)follows a state smoothly, for springs and tweens driven by code.- Constructors take a props table: properties,
Style,Classes,Childrenand event handlers by name. Entries without a key are children too, parented afterChildren, soUi.View({ Gap = 4, title, body })works. Building the tree by hand withUi.new("View")and parenting still works, and is what the constructors do underneath.Ui.new(className, props)takes the same props for any class that can be created, such asPart.
What exists today:
Ui.State(value)hasGet,SetandChanged(whoseConnectreturns a connection withDisconnect). Setting the value it already holds fires nothing.Ui.Computed(function(use) ... end)runs at once and again whenever a state or computed it read throughusechanges, and follows only what the last run read.Seton it is an error, andDestroystops it.- A constructor prop given a state or computed sets the property and follows it; destroying the node stops that. A property it sets counts as set on the node, so style sheets leave it alone.
Ui.ForEach(list, render, key)turns a list, or a state holding one, into a computed list of nodes forChildrenor a props table's children.keyis a field name ("Id"), a function of the item, or left out to use the item itself; a key seen again reuses its node, a key that goes destroys its node, and a key twice is an error. The bound nodes come after the node's other children, in the list's order, and only those out of place are moved.Ui.Spring(source, speed, damping)follows a state or computed as a spring:speedis its angular frequency in radians a second (10) anddampingits damping ratio (1 settles fastest without overshooting; below 1 bounces). A new goal keeps the velocity it has, so a value can be dragged around and let go. It moves numbers,Vector2,Vector3andColor; anything else jumps.Ui.Animated(source, info)follows a state or computed over the time and easing of aTweenInfo(0.2 seconds,Quad,Outby default), from wherever it has got to when the goal changes. It blends numbers,Vector2,Vector3,ColorandTransform; anything else jumps at the end.Ui.StyleSheettakes states and computeds as values in its table ([".card"] = { Background = accent }), or one holding the whole text or table, and writes the sheet'sSourceagain when one changes, so a theme can be a state. Every node it styles restyles at the next layout.- Binding the same node's children to two lists moves the first list's nodes after the second's when it changes.
Widgets
The Widgets global builds controls out of Views and Text, so a style sheet can restyle any of them. Each returns a View with a class named after the widget (Button, Checkbox, Switch, Slider, RadioGroup, Select, NumberInput, ColorPicker, Table, Tree, ProgressBar, Spinner, Accordion, Splitter, Tabs, Dialog, VirtualList, Markdown; a MenuButton is a Button with the MenuButton class too) and passes any props it does not use itself, such as Name, Classes or Width, to that View. Widgets.Theme() makes a style sheet with the default look, to put in the surface; it reads --accent, --accent-text, --text, --border, --control, --muted, --radius and --focus, so surface:SetAttribute("--accent", "#e11d48") recolours every widget.
local volume = Ui.State(50)
Ui.Surface({
Children = {
Widgets.Theme(),
Widgets.Button({ Text = "Save", Activated = save }),
Widgets.Button({ Text = "Cancel", Variant = "ghost", Activated = cancel }),
Widgets.Checkbox({ Text = "Sound", Checked = soundOn }),
Widgets.Slider({ Value = volume, Min = 0, Max = 100, Step = 5 }),
Widgets.RadioGroup({ Options = { "Easy", "Normal", "Hard" }, Value = difficulty }),
},
})- Button:
Text,Activated(on a click, Enter or Space),Variant(sets theVariantattribute; the theme drawsghostwith an outline) andDisabled. - Checkbox and Switch:
Text,Checked,Changed(value)andDisabled. A click or Space toggles them. - Slider:
Value,Min(0),Max(100),Step(1, or 0 for any value),Changed(value)andDisabled. A press sets the value under the pointer and captures it, so dragging past the ends works; the arrow keys, Page Up, Page Down, Home and End step it. The track's parts areSliderTrack,SliderFillandSliderThumb. - RadioGroup:
Options(strings, or{ Value = ..., Text = ... }),Value,Changed(value)andDisabled. Only the checked radio, or the first, is in the tab order, and the arrow keys move the choice, as on the web. - A value prop given a state is kept in step both ways: the widget follows the state and sets it when the user changes it. A plain value is where the widget's own state starts.
Disabledmay be a state too, and sets theDisabledattribute that:disabledmatches;CheckedsetsCheckedfor:checked. - Select:
Options(as for RadioGroup),Value,Placeholder,Changed(value)andDisabled. A click, Enter or Space opens its list, which closes on a choice, Escape, Tab or a click anywhere else; the arrows move the highlight while it is open and change the value while it is closed. The root has theOpenattribute while it is open, and the list's parts areList,ListRow(withHighlightedandSelectedattributes) andListSeparator. - NumberInput:
Value,Min,Max,Step(1, which also sets how many decimals it shows),Changed(value),PlaceholderandDisabled. Its parts are aTextInput(NumberInputField) and twoNumberInputStepbuttons. Typed text takes effect on Enter or when the field loses focus, snapped toStepfromMinand kept betweenMinandMax; text that is not a number puts the value back. Up and Down step it. - MenuButton:
Text,Items({ Text = ..., Activated = ..., Disabled = ... }, or"-"for a separator),VariantandDisabled. It opens the same list, and choosing an item runs itsActivated. - Tabs:
Tabs({ Key = ..., Text = ..., Content = node }),Value(the chosen key, the first by default) andChanged(key). Only the chosen tab's content is in theTabPanel; the rest are kept out of the tree. The arrow keys, Home and End move between tabs. - Dialog:
Open,Title,Closed(),Dismissable(true) and children. It returns aDialogBackdropthat covers its parent, so put it in the surface; theDialogbox inside takes focus when it opens. Escape or a click on the backdrop closes it unlessDismissableis false. While it is open, Tab and Shift+Tab go round the focusable nodes inside it, and when it closes, focus goes back to the node that had it before.Surface.FocusedNodereads which node has a surface's focus. - Tooltip:
Widgets.Tooltip(anchor, text, delay)showstextunderanchorafterdelayseconds (0.4) while the pointer rests on it or it has focus, in the anchor's surface, and returns theTooltipnode. - VirtualList:
Items(a list or a state),Render(item, index),ItemHeightandOverscan(3 rows). It scrolls, and makes nodes only for the rows in view, placing each absolutely at its row; give it a height.ItemHeightis a number of pixels for every row (32), a function(item, index) -> numberfor rows whose heights you know, or"auto"for rows that size themselves, such as wrapped text: those start atEstimatedItemHeight(32) and the rows below move once each has laid out, so the scroll bar settles as you scroll. - Markdown:
Text(Markdown, or a state holding it) becomes nodes: headings (MarkdownHeadingandMarkdownH1toMarkdownH6), paragraphs (MarkdownParagraph), bulleted and numbered lists nested by indentation (MarkdownList,MarkdownListItem,MarkdownBullet,MarkdownListText), block quotes (MarkdownQuote), fenced code blocks (MarkdownCode,MarkdownCodeText), tables with column alignment (MarkdownTable,MarkdownTableRow,MarkdownTableHeader,MarkdownTableCell), rules (MarkdownRule) and images on a line of their own (MarkdownImage). Inline,**bold**,`code`,~~struck~~, links and<https://...>become rich text, and*emphasis*is coloured, since there are no italic faces yet. A click on a link callsLinkActivated(url); open it withProcessor handle it in the game. A line ending in two spaces or a backslash breaks there. Raw HTML is shown as written. - ProgressBar:
Valueout ofMax(100), shown by the width of itsProgressFill. WithValuenil it has theIndeterminateattribute, and the theme slides its fill back and forth with@keyframes. - Spinner: three
SpinnerDots that the theme pulses one after another, for work of unknown length. - Accordion:
Sections({ Key = ..., Title = ..., Content = node }),Value(the open key, or withMultiple = truea list of open keys) andChanged(value). EachAccordionSectionhas anAccordionHeaderthat opens or closes it on a click, Enter or Space (closing the open one unlessMultiple), and anAccordionPanelshown while it is open; the section has theOpenattribute. Up, Down, Home and End move between headers. - Splitter:
FirstandSecondnodes in twoSplitterPanes, side by side or, withDirection = "Column", one above the other, and aSplitterHandlebetween them.Valueis the first pane's share of the space (0.5), kept so neither pane is smaller thanMinpixels (40), andChanged(value)follows it as the handle is dragged or, with the handle focused, moved 5% by the arrows. - Toast:
Widgets.Toast(surface, text, options)shows aToastin aToastStackat the bottom right of the surface, above the rest, foroptions.Durationseconds (4; 0 keeps it).Variant("info","success"or"error") sets its attribute for the theme, andAction = { Text = ..., Activated = ... }adds aToastActionbutton that runs and dismisses it. A click anywhere else on it dismisses it too. It returns the toast and a function that dismisses it; dismissing setsLeaving, which the theme fades out, and removes it a quarter of a second later. - ContextMenu:
Widgets.ContextMenu(target, items)opens a menu ofitems(asMenuButtontakes them) at the pointer whentargetis right-clicked, in its surface above the rest, with the keys ofSelect's list. A choice, Escape, Tab or a click anywhere else closes it. It returns theContextMenuanchor, a View of no size at the pointer that the list hangs from. - ColorPicker:
Value(aColor, white by default),Changed(color)andDisabled. AColorPickerAreasquare picks saturation across and brightness up, aColorPickerHuestrip picks the hue, and aColorPickerHexTextInputbeside aColorPickerSwatchtakes a code such as#3b82f6or3b8on Enter or blur (anything else puts the code back). Hue and saturation are kept apart from the colour, so dragging to black or grey and back does not lose them. The square and the strip take focus, and the arrows move them by 1% or 1 degree, ten times as far with Shift. WithAlpha(a number from 0 to 1, or a state), aColorPickerAlphastrip under the hue picks the opacity, withAlphaChanged(alpha), since aColorhas no alpha of its own; the field then shows and takes eight digit codes such as#3b82f680. - Table:
Columns({ Key = ..., Header = ..., Width = ..., Sortable = ..., Resizable = ..., MinWidth = ..., Render = function(row), SortValue = function(row) }),Rows(a list of tables, or a state),Value(the selected row) withChanged(row),Activated(row), andSortKey,SortDescendingandSorted(key, descending). A column withoutWidthshares the space left; a cell showsRender(row), a node or text, or elsetostring(row[Key]). A click on a sortable header sorts by it, and a second click reverses the order; the header cell has theSortedattribute ("ascending"or"descending"). TheTableBodyscrolls when the table has a height, takes focus, and moves the selection with the arrows, Page Up, Page Down, Home and End, scrolling it into view; Enter or a double click on a row callsActivated. Dragging the right edge of aResizablecolumn's header (itsTableResizer) sets the column's width, down toMinWidth(30), and callsColumnResized(key, width). WithRowHeight, every row is that many pixels tall and only the rows in view, and three either side, have nodes, placed in a content node as tall as all of them, so a table of thousands of rows stays quick. Its parts areTableHeader,TableHeaderCell,TableSortMark,TableResizer,TableRow(withSelected) andTableCell. - Tree:
Items({ Key = ..., Text = ..., Children = { ... } }, or a state),Expanded(keys of branches open at first),Value(the selected key) withChanged(key),Toggled(key, open)andActivated(key). Only the selected row, or the first, is in the tab order. Up and Down move between the rows shown, Right opens a branch and then goes into it, Left closes it and then goes to its parent, Home and End go to the ends, Enter opens or closes a branch, and a click on the caret or a double click on the row does too. Enter or a double click on a leaf callsActivated(key). The selection follows focus; closing a branch around it selects the branch. An item withHasChildren = trueand noChildrenis a branch whose childrenLoadChildren(key)returns the first time it opens. It runs in a task of its own, so it can wait on a request, and meanwhile the row hasLoadingand the group shows aTreeLoadingrow. The children are kept whenItemschanges, a load that errors says so and tries again when the branch next opens, and a branch that loads no children becomes a leaf. WithMultiple = true,Valueis a list of keys andChangedgets the list: a click selects one row, Control (or Meta) with a click adds or removes one, Shift with a click or an arrow selects every row shown from the last one chosen, Control with an arrow moves focus without changing the selection, Space adds or removes the focused row, and Control+A selects every row shown. Its parts areTreeItem,TreeRow(withSelectedand, on a branch,Expanded),TreeCaret,TreeLabel,TreeGroup, indented by the theme, andTreeLoading.
Animation
- Transitions (done):
Transition = "Opacity 200ms EaseOut, Background 0.3s 0.1s linear"animates a property when its value changes for any reason: a state, a style rule starting or stopping to match, a script setting it. Each entry is a property name (orall, or a shorthand such asPaddingfor its sides), a duration, an optional delay and an optional easing:linear,ease,ease-in,ease-out,ease-in-out(also writtenEaseInOut),cubic-bezier(),steps(), orspring(stiffness, damping)(springalone isspring(170, 26)), which moves as a spring of unit mass from rest, may overshoot, and lasts until it settles when the entry gives no duration, as in"Transform spring(300, 20)". Animations take a spring easing the same way. A change partway through starts from the value shown. Transitions advance when the surface lays out, so they run while the surface is drawn every frame.- Numbers, colours (mixed with premultiplied alpha), lengths, box shorthands and transform lists made of the same functions blend. Anything else, such as an enum,
autoor two different transform lists, switches at once. - The property reads back the value shown, as
getComputedStyledoes.node:IsTransitioning("Opacity")tells whether one is running, andTransitionEndedfires with the property's name when it arrives. A saved place and a clone keep the value it was going to. - A node outside a surface changes at once, as does a transition removed from
Transitionwhile it runs.
- Numbers, colours (mixed with premultiplied alpha), lengths, box shorthands and transform lists made of the same functions blend. Anything else, such as an enum,
- Keyframes (done):
@keyframes Pulse { from { Opacity: 1 } 50% { Opacity: 0.4 } to { Opacity: 1 } }in a style sheet (or["@keyframes Pulse"] = { from = {...}, ["50%"] = {...} }in a table), run withAnimation = "Pulse 1s ease-in-out infinite alternate". An entry takes CSS's animation shorthand in any order: the name, a duration, a delay, an easing (applied between each pair of steps), an iteration count orinfinite, a direction (normal,reverse,alternate,alternate-reverse) and a fill mode (none,forwards,backwards,both), with commas between animations.- A step that leaves out a property, including a missing
fromorto, uses the node's own value there. Values blend as transitions' do, and a number against a length is that many pixels; anything else switches halfway between its steps.var()is not read inside keyframes yet. - An animation starts at the first layout after it is named, or after its node joins a surface, and keeps playing while a restyle names it again. While it plays, its values win over the node's own and its styles'; the property reads back the animated value, and a place saves the node's own.
AnimationEndedfires with its name after its last iteration. - The rules come from every enabled style sheet in the surface, a later sheet's winning for the same name.
- A step that leaves out a property, including a missing
- Code: the tween service and
Ui.Animatedfor anything else.Tweens:Createblends a UI node's colour, length and transform strings as transitions do, and switches any other string at the end. - Every property with a numeric, length, colour or transform value can be animated.
prefers-reduced-motionis visible to style sheets.
Accessibility
Each surface keeps an accessibility tree from node roles (Role = "Button"), labels and states, exposed to the OS screen reader through SDL or the platform API. Widgets in the library set roles themselves. Focus is always visible with :focus-visible, and everything reachable by pointer is reachable by keyboard.
Compared with the web platform
Status: done, next (in the current phase of the plan), planned (a later phase), later (no step yet), out (not planned).
| Web feature | Gamma | Status |
|---|---|---|
Box model, box-sizing, min/max sizes | yes | done |
| Flexbox | Yoga | done |
%, px, auto lengths | strings and numbers | done |
em, rem, vw, vh, calc sums | yes | done |
fr | grid tracks | done |
| Grid | Gamma's own | done (named areas later) |
| Absolute and fixed positioning | yes | done (absolute), planned (fixed) |
| Sticky positioning | yes | later |
z-index, stacking contexts | yes | done |
| Overflow, clipping, scrolling | Overflow, ScrollView | done (rectangular clipping, wheel scrolling, draggable scroll bars, ScrollIntoView), planned (momentum, touch) |
| Backgrounds, gradients, images | yes | done (solid colours, Image nodes from files and URLs, ObjectFit, nine-slice), planned |
| Border radius, borders, outlines | yes | done (radius and solid borders), planned (outlines, styles) |
| Box and text shadows | yes | planned |
| Opacity, filters, backdrop filters, blend modes | yes | done (opacity, multiplied), later |
| Transforms (2D) | yes | done |
| Transforms (3D), perspective | world surfaces instead | out |
| Cascade, specificity, inheritance | yes | planned |
| Selectors and pseudo-classes | most | done, with :has, :is and :where |
Custom properties (var()) | yes | planned |
| Media and container queries | yes | planned (media), later (container) |
| Transitions | yes | done |
| Keyframe animations | yes | done |
| Web fonts, fallback, weights | font files and assets | done (files, fallback by character, nearest weight) |
| Complex shaping, bidi | HarfBuzz | later |
| Inline formatting, spans, inline nodes | Text spans | partly (styled runs through RichText and Spans; no links or inline nodes yet) |
| Text selection and copying | UserSelect | done (within one Text node; Control+C copies) |
| Form controls | widget library | done (button, checkbox, switch, slider, radio group, select, number input, colour picker, menu button) |
| Text editing, IME | TextInput | done |
DOM events, capture and bubble, preventDefault | yes | done (pointer, wheel and key events with capture and bubble phases, PreventDefault, pointer capture, PointerEvents, IsHovered/IsPressed, DoubleClick) |
| Focus, tab order | yes | done (focus, TabIndex, Tab order, :focus, :focus-visible and :focus-within, arrow keys in widgets, spatial navigation with SpatialNavigation, ScrollIntoView), planned (gamepad, which needs gamepad input first) |
| Drag and drop, file drop | yes | done (within the UI: Draggable, DragStart to DragEnd, :drag-over), later (files from the OS) |
| Clipboard | SDL | done (text in TextInput), planned (events) |
ResizeObserver, MutationObserver | LayoutChanged, tree events | done (LayoutRect), planned |
<canvas> 2D | Canvas | later |
| WebGL | Viewport with the 3D renderer | later |
<video>, <audio> | media nodes | later |
| Accessibility tree | yes | later |
| Reactive state | built in | planned |
HTML markup, innerHTML, the browser DOM API | Luau constructors instead | out |
| Running JavaScript or arbitrary web pages | not a browser | out |