Reference

Reference

146 built-in elements by family, every command, setting and design token — each read from the compiler itself, so what these pages list is exactly what it accepts.

Language and tools

Layout

Container

Centred wrapper with a maximum width and horizontal padding.

Row

Horizontal flex layout. It stays a row at every width unless .stacks or a responsive direction says otherwise.

Column

A child of the 12-column grid, spanning span columns.

Grid

CSS grid with a fixed number of columns.

Stack

Vertical flex layout.

Spacer

Vertical space; md when no size is given.

VirtualList

A scrolling box that draws only the rows in view of the one keyed for inside it — for a tree, search results or a diff of thousands of rows.

Splitter

A handle that sets the size of a region beside it: dragged, between min: and max:; double-clicked or Enter, back to reset:; the arrow keys move it.

Divider

Horizontal rule.

Masonry

Its children in columns: columns, each placed under the last in its column, keeping its own height.

AspectRatio

A box that keeps its shape as its width changes — ratio: 16 / 9 — its child filling it: a picture, a video, a frame.

ScrollArea

A box that scrolls within height:, with a thin scrollbar, its edges fading where there is more, and a Tab stop so a keyboard can scroll it.

Center

Its children in the middle of it, across and down.

Sticky

A box that sticks to the top of its scrolling parent (offset: below it) as the page scrolls past, marked data-stuck while it is stuck.

PanelGroup

Panels side by side (or .vertical, one above another) with a handle between each two that resizes them: dragged, or the arrow keys on it. bind: holds their sizes in percent — a persist keeps them across visits — and on resize(e) hears them as e.detail.

ClientOnly

Its block drawn in the browser alone, never in the static paint, a template or a PDF: a clock, the reader's own data. A placeholder { … } block is what those show in its place.

AppShell

An app's frame: AppShell.Header across the top, a Sidebar down the start (a drawer on a narrow screen), the Router's page beside it, and an AppShell.Footer.

Host

A bare node handed to somebody else's code, with a lifetime. mount: runs with the node each time it is made, update: again whenever the state it reads changes, and cleanup: when the page, branch or list item it belongs to leaves. Every other element takes the same three.

Portal

Its block, drawn into a node somebody else's code owns: an element a script hands over, or a ref: handle. When into: names another node the block moves there with its nodes and state; null keeps it aside until a node comes back; it goes when the page, branch or list item it is written in leaves. What is inside belongs to where it is written: its handlers, emit and lifetimes.

Element

A custom element a script defines, placed by its tag: Element("stripe-pricing-table", publishableKey: key) { on ready { … } }. Every named argument is an attribute, every on handler an event it fires, and the block its children.

Navbar

Top navigation bar with brand, links and action areas.

Sidebar

Side navigation. A Sidebar.Item whose to matches the current route is marked .active and aria-current="page".

Link

Client-side navigation link; its label or its block is the link text.

Tabs

Tab strip switching between its pages: the arrow keys move between the tabs (the other way round in a right-to-left page), Home and End go to the ends.

Breadcrumb

Breadcrumb trail. An item without to is the current page.

Menu

A menu above everything: opened by its trigger: button, or by visible: at an anchor: or a point at: — a context menu. Escape, a press outside or a choice close it, write false back to visible: and fire on close.

NavigationMenu

A site's main navigation whose entries open panels (a mega menu) as disclosures: one open at a time, the arrow keys along the row, Down into a panel, Escape, a press outside or the focus leaving closes it.

Menubar

File, Edit and View, as in a desktop app: one Tab stop, the arrow keys along it; Down or Enter opens a menu, and with one open Left and Right open the one beside it.

ContextMenu

What it wraps, and a menu a right-click, a long press, the menu key or Shift+F10 inside it opens where it happened.

BottomNavigation

A phone's tab bar along the bottom of the screen: each entry an icon over its words, at least 44px to press, clear of the home indicator (the safe-area inset); the current route's is marked.

PrevNext

The pages before and after this one in an ordered set — a guide's chapters: each a link that says which way it goes and the page's title.

OnThisPage

The page's headings as links, the one being read marked as the reader scrolls: a table of contents beside a long page.

Pagination

Pages of a list: Previous, the first and last pages, those around the current one with a gap for the rest, and Next. The current page is aria-current="page"; bind: holds it, from 1.

Stepper

Steps taken in order — an account, then billing, then a summary — with each step's state (done, current, an error) and the current step's block shown. bind: holds the current step, from 0; .linear keeps a step out of reach until the ones before it are passed.

CommandPalette

A dialog of everything a reader can do or go to, filtered as they type: the arrow keys go through what matches, Enter runs it (on select) and closes. open: is the state that shows it.

Routing

Data display

DescriptionList

Terms and what they are (<dl>): a column of pairs, or .grid, each term beside its value.

Timeline

Events in order (<ol>), each a dot on a line, its title, its time and its block.

AvatarGroup

Avatars overlapping in a row: past max: the rest are one +3.

Item

A row of a list, a settings page or a search's results: Item.Media at its start, its title: and description:, then its block, and Item.Actions at its end.

Sparkline

A tiny chart in a line of text — a line, or .bar — of a list of numbers, drawn as an SVG when the page is built.

RelativeTime

A moment as 3 minutes ago, kept current, with the exact time on hover (<time>).

Card

Card surface with optional header, body and footer sections.

Table

Data table. Cells inside Table.Head render as <th scope="col">; caption is the table's accessible name, visually hidden.

List

List of its children; ordered for a numbered list.

Badge

Small status label.

Tag

Compact chip.

Avatar

A picture of a person, or their initials.

Tooltip

Shows text above everything when its child is hovered (after delay:) or focused from the keyboard.

Tree

Nested items — files and folders, an outline — as a tree a keyboard can work: Up and Down through what shows, Right to open and go in, Left to close and go out (the other way round right to left), Home and End, a letter. row(item) { … } draws each; bind: holds the chosen item's key, or a list of keys with .multiple.

DataTable

Rows of records with their columns declared once: a column sorts when it is .sortable (its header a button, aria-sort saying which way), cell(r) { … } draws a cell, empty { … } shows when there are no rows, and bind: chooses rows (a list with .multiple, a box for each and one for all).

Chart

A chart drawn as vector graphics when the page is built: bars, lines, areas, a pie or a donut over a list of records.

QrCode

A QR code for a URL or any text, drawn as vector graphics when the page is built.

Content

Form

ColorPicker

A colour, chosen from swatches: (each a button, the chosen one pressed), with the browser's own picker, or typed as hex; bind: holds it as #rrggbb.

TransferList

Two lists side by side — what can be chosen and what is — with buttons that move the selected across, or all of them; bind: holds the keys of the chosen.

Editable

Text that turns into a field when pressed: Enter or leaving keeps what was typed, Escape puts it back; bind: holds the text.

Input

Text field. With label, hint or error it is a labelled field.

Select

Drop-down of Select.Option children.

Checkbox

Checkbox bound to a boolean state.

Radio

One choice of a group; every radio bound to the same state is one group.

Switch

On/off toggle bound to a boolean state.

Slider

Range input. aria-* and its other attributes reach the input; with aria-valuetext the raw number is not shown beside the track.

DatePicker

A date field: the reader picks a day, and the bound state holds a Date.

FileUpload

File input; bind: holds what was chosen, and on change hears it.

Form

Groups controls; on submit runs when it is submitted, and the page never navigates away.

Textarea

Several lines of text. With label, hint or error it is a labelled field; with maxLength it counts what is left.

Field

A label, a hint and an error around a control of your own: the first control in its block is named by the label and described by the hint and the error, and marked invalid while there is one.

Fieldset

Controls that belong together — an address, a choice of plan — under a legend that names them.

InputGroup

An input drawn as one box with what goes beside it: an icon, InputGroup.Addon("https://"), a button, or InputGroup.Clear, which empties the input and gives it the focus back.

RadioGroup

One choice of several, as native radio buttons under a legend: the arrow keys move between them, and .cards draws each as a card with its hint.

NumberInput

A number with − and + beside it: the arrow keys step it, PageUp and PageDown by ten steps, and it stays between min: and max:.

Calendar

A month as a grid of days, chosen with a press or the keyboard — the arrows by day and week, PageUp and PageDown by month, Home and End to the week's ends — one day, a range, or several. bind: holds a Date, a { start, end } with .range, a list with .multiple.

Listbox

A list of options always shown, one chosen (selection follows the arrow keys) or, .multiple, several: Space chooses, Shift with an arrow takes the next one in too, Ctrl or ⌘ with A takes them all; a letter goes to the next option that starts with it.

Combobox

A text field that offers what matches as the reader types: from options:, or search: asked of a server. The arrow keys go through the offers, Enter takes one, Escape closes them; .multiple keeps several, each a chip Backspace takes back. option(o) { … } draws an offer; empty { … } shows when nothing matches.

CheckboxGroup

Check boxes under a legend whose bind: is the list of the values ticked, with all: a box above them for every one at once — ticked when all are, mixed when some are.

InputOTP

A one-time code typed a digit to a box: the focus moves on as each is typed and back with Backspace, and a code pasted into any box fills them all; the browser offers the code it was sent (autocomplete="one-time-code").

TagInput

Words typed into a field, each a chip once Enter or a comma ends it; Backspace in the empty field takes the last back, and each chip has a button to take it out.

Rating

Stars, as radio buttons a screen reader hears as a choice of one to max:: the arrow keys move between them; .half takes halves; .readonly only shows.

DateRangePicker

A first and a last day, chosen in two months side by side that a button opens, or by a preset: presets: [.last7, .thisMonth]. bind: holds { start, end }.

Feedback

HoverCard

A preview card at a link or a button: shown after delay: ms of hover, at once on focus; it stays while the pointer is on it, and goes when the pointer leaves both, on Escape or on a press outside.

LoadingOverlay

A region covered while it is busy: aria-busy on it, its content out of reach, and a spinner with label: over it — the region, not the page.

Tour

A tour of the page while open: holds: each step in a card at its target: (a ref:), lit through a cut-out in the dimmed page, with Back, Next and Done; Escape ends it and writes false back. on finish hears Done, on close any end.

ConsentBanner

The reader's say over the scripts that track them: shown until they choose, Decline as easy as Accept, and the choice kept. Accepting loads the meta.scripts entries marked "load": "consent", then and on every later visit; nothing loads before.

ConsentSettings

A button that asks the reader again — a footer's "Cookie settings": it forgets their answer and shows the ConsentBanner. A script already loaded stays until the page is loaded again.

CircularProgress

A ring that fills to value: of max:, announced as a progress bar; with no value:, it turns, for work of no known length. Its block is drawn in the middle.

Meter

A level against its range (<meter>): a disk's use, a password's strength. Past high: or under low: it says so in its colour; optimum: says which end is good.

Popconfirm

A question beside the button in its block before what it does: the button opens it, on confirm hears yes, on cancel no or Escape; the focus starts on the answer that loses nothing.

Alert

Inline notice; a danger or warning one is announced as an alert.

Toast

Temporary notification.

Modal

Modal <dialog>, opened by a state flag; the browser supplies focus trapping and Escape. on close runs when it closes, however it was closed, and the focus goes back to what had it.

Popover

A layer at a control: drawn above everything, placed against its anchor:, closed by Escape or a press outside, which write false back to visible: and fire on close.

Dialog

Confirmation <dialog>, opened by a state flag. on close runs when it closes, however it was closed, and the focus goes back to what had it.

AlertDialog

A <dialog> that asks before something that cannot be undone: role="alertdialog", its body read out with its title, and closed by Escape or its own buttons, not a press outside. For a question asked from a handler, await ask(…) draws one.

Sheet

A modal <dialog> that comes in from an edge: the bottom (a phone's filters, a share list) or the start or end of the line. Dragged by its handle or heading toward its edge it closes; a bottom sheet with snap: points settles at the nearest.

Spinner

Loading indicator, announced as a status.

Progress

Progress bar; a value that reads state moves with it.

Skeleton

Placeholder shape shown while content loads.

Actions

Media

Typography

PDF

Slides

On every element

Every element takes these props, and the HTML attribute families named on it (aria-*, data-*, and the global attributes such as id, class, title, role, tabindex).

On every element
PropTypeMeaning

animate:

one of its cases

Animation played when the element appears. Written as a flag, .fadeIn, or by name, animate: .fadeIn.

  • .fadeIn: Fade in
  • .fadeOut: Fade out
  • .slideUp: Slide up into place
  • .slideDown: Slide down into place
  • .slideLeft: Slide in from the right
  • .slideRight: Slide in from the left
  • .scaleIn: Grow into place
  • .scaleOut: Shrink away
  • .bounce: Bounce
  • .shake: Shake
  • .pulse: Pulse
  • .spin: Spin
  • .expand: Open to the height of what is inside, which CSS alone cannot do
  • .collapse: Close to nothing

exit:

one of its cases

Animation played when the element leaves. Written by name: exit: .fadeIn.

  • .fadeIn: Fade in
  • .fadeOut: Fade out
  • .slideUp: Slide up into place
  • .slideDown: Slide down into place
  • .slideLeft: Slide in from the right
  • .slideRight: Slide in from the left
  • .scaleIn: Grow into place
  • .scaleOut: Shrink away
  • .bounce: Bounce
  • .shake: Shake
  • .pulse: Pulse
  • .spin: Spin
  • .expand: Open to the height of what is inside, which CSS alone cannot do
  • .collapse: Close to nothing

speed:

one of its cases

How fast its animation runs. Written as a flag, .fast, or by name, speed: .fast.

  • .fast: 150ms
  • .normal (the default): The default
  • .slow: 500ms

duration:

String

Animation length, e.g. 300ms

delay:

String

Wait before the animation starts

easing:

one of its cases

How the animation is paced — a named easing, or any CSS timing function. Written by name: easing: .standard.

  • .standard (the default): The design's own pacing
  • .spring (the default): Overshoots a little and settles, like a real spring
  • .ease (the default): Slow at both ends
  • .easeIn (the default): Slow to start
  • .easeOut (the default): Slow to stop
  • .easeInOut (the default): Slow at both ends, more so than ease
  • .linear (the default): The same speed throughout
  • .bouncy (the default): Overshoots hard
  • .smooth (the default): Even, with no overshoot

stagger:

String

Delay added per item of a list, e.g. 50ms

on:

one of its cases

When its animation plays. Written by name: on: .mount.

  • .mount: When it appears (the default)
  • .enterView: When it first scrolls into view

count:

String

How long the number it shows takes to count to a new value, e.g. 600ms

shared:

String

A name this element keeps across a route change, so the browser carries it from one page to the next

class:

String

Classes added beside the engine's, from the project's own stylesheets

ref:

State

A handle on the element, usable as the element: ref: nameInput, then nameInput.focus()

drag:

Json

What it carries when it is picked up — by a mouse moved a few pixels, or a finger held still — and dropped on something with on receive(d)

dragGroup:

String

Which drops it belongs to: a drag goes only to targets of its own group, so tabs and tree rows stay apart

dropValue:

Json

What this target is, as a drag sees it: d.over in the drag's on dragmove(d) and in on receive(d)

dropAxis:

one of its cases

Which way its list runs, for where a drop lands. Written by name: dropAxis: .y.

  • .y (the default): A list down the page: before is above, after below (the default)
  • .x (the default): A list across it, a tab strip: before is to the start, after to the end

dropInside:

Bool

A drop on its middle lands inside it — a folder, a container — as well as before or after. Written as a flag, .dropInside, or dropInside: true.

roving:

one of its cases

One Tab stop for the group, and the arrow keys, Home, End and the first letters of a name to move inside it: a toolbar, a row of choices, a list. Written by name: roving: .x.

  • .x (the default): A row: ArrowLeft and ArrowRight move, the other way round in a right-to-left box
  • .y (the default): A column: ArrowUp and ArrowDown move
  • .both (the default): Both: a wrapping row of choices

trapFocus:

Bool

While true, focus moves into it and Tab and Shift+Tab stay inside; when it turns false or the element leaves, focus goes back where it was. Written as a flag, .trapFocus, or trapFocus: true.

mount:

(Element) -> Handle

Run with the element each time it is made — mount: (n) => initTilt(n) — and what it returns is the handle update: and cleanup: get

update:

(Handle) -> ()

Run with the handle again whenever the state it reads changes: update: (h) => h.setMax(max)

cleanup:

(Handle) -> ()

Run with the handle when the element leaves — a route change, an if branch, a list item: cleanup: (h) => h.destroy()

Events
EventSendsMeaning
on click—The element was clicked or activated
on input—The value changed, on every keystroke
on change—The value was committed
on submit—The form was submitted
on focus—The element received focus
on blur—The element lost focus
on keydown—A key went down; `e.key` names it
on longpress—Held still for half a second; `p.x`, `p.y` say where. The click it ends with is not a click
on swipe—A finger or a pen swept across it; `s.direction` is "left", "right", "up" or "down"
on receive—Something with `drag:` was dropped on it; `d.value` is what, `d.position` "before", "after" or "inside"
on dragmove—On what is dragged, while it moves: `d.over` is the target's `dropValue` or null, `d.position` where it would land
on visible—It came into view: scrolled to, or drawn where the reader is looking. `v.ratio` is how much of it shows. A "load more" row's cue
on key—One key, named: `on key("ctrl+k") { }`
on keyup—A key came up
on keypress—A character key was pressed
on mouseenter—The pointer entered the element
on mouseleave—The pointer left the element
on dblclick—The element was double-clicked
on auxclick—A button other than the main one was clicked; `e.button` is which — 1 is the middle, which closes a tab
on focusin—Focus moved onto the element or something inside it
on focusout—Focus left the element or something inside it
on contextmenu—The context menu was asked for; `e.preventDefault()` keeps the browser's
on mousedown—A mouse button went down over the element
on mouseup—A mouse button came up over the element
on mousemove—The mouse moved over the element
on mouseover—The pointer moved onto the element or one of its children
on mouseout—The pointer moved off the element or one of its children
on pointerdown—A pointer — mouse, pen or touch — went down
on pointerup—A pointer came up
on pointermove—A pointer moved
on pointerenter—A pointer entered the element
on pointerleave—A pointer left the element
on pointercancel—The browser took the pointer back, for a scroll or a gesture
on touchstart—A finger touched the element
on touchend—A finger left the element
on touchmove—A finger moved across the element
on wheel—The wheel or trackpad scrolled over the element
on scroll—The element's content scrolled
on reset—The form was reset
on invalid—A control failed the browser's own validation
on select—Text in a field was selected
on copy—Something was copied from the element
on cut—Something was cut from the element
on paste—Something was pasted into the element; `e.clipboardData` holds it
on dragstart—The element started being dragged
on drag—The element is being dragged
on dragend—A drag of the element ended
on dragenter—Something dragged entered the element
on dragover—Something dragged is over the element; `e.preventDefault()` allows a drop
on dragleave—Something dragged left the element
on drop—Something was dropped on the element; `e.dataTransfer` holds it
on load—An image, video or frame finished loading
on error—An image, video or script failed to load
on play—A video or audio started playing
on pause—A video or audio paused
on ended—A video or audio reached its end
on timeupdate—A playing video or audio moved on
on animationend—A CSS animation on the element ended
on transitionend—A CSS transition on the element ended
on toggle—A details element opened or closed

Icons

The names Icon(…), IconButton(icon:) and Sidebar.Item(icon:) draw; any other name shows as the word, and the compiler warns.

close

menu

search

home

user

settings

check

plus

minus

edit

trash

star

heart

mail

bell

download

upload

eye

link

calendar

filter

chevron-down

chevron-right

chevron-left

info

warning

arrow-left

arrow-right

logout

copy

sun

moon

folder

folder-plus

folder-off

file

file-plus

refresh

alert-circle

clock

dot

diff

book

git-pull-request

pin

git-branch

more-horizontal

window-minimize

window-maximize

outline

help-circle

collapse-all

locate

chevron-up

globe

external-link

panel-down

panel-up

code

monitor

git-commit

play

layers

insert

grid

list

square

pill

image

sparkle

lock

type

pointer

reach

frame

line

pipette

comment

hand

zoom

ruler

eye-off

unlock

Older spellings

Names from earlier versions of the language that the compiler still accepts. New code writes the current name.

Older spellings
Older spellingWrite insteadMeaning

TabPage

Tabs.Page

One tab inside Tabs (the original spelling of Tabs.Page).

Thead

Table.Head

Table header section (the original spelling of Table.Head).

Tbody

Table.Body

Table body section (the original spelling of Table.Body).

Trow

Table.Row

Table row (the original spelling of Table.Row).

Tcell

Table.Cell

Table cell (the original spelling of Table.Cell).

Option

Select.Option

One choice in a Select (the original spelling of Select.Option).

Route

page

Maps a path to a page (the original grammar; pages now declare their paths).