Skip to content

Properties ​

Generated by pnpm docs:reference from packages/core/src/properties/UiProperty.ts. Do not edit this page; edit the registry, or the notes in apps/docs/src/reference/property-notes.ts.

There are 165 properties. Every element accepts every one of them, because a property is a slot on a node rather than something a particular element declares. A property nothing sets costs nothing: it is not stored, and it resolves to the default below.

Default is what the property resolves to when no ancestor provides it and nothing sets it. unset means exactly that: the property holds no value, and whatever reads it decides what to do, which for a length usually means sizing from content. A default printed as plain words rather than in code is one whose real value is an object, described here because printing it would not help.

Inherited means the value is looked up through the environment rather than stopping at the node. 13 properties inherit, and they are all text style: set fontSize on a container and every text node below reads it. The properties in Environment are the other side of that, the ones that provide a value for a subtree.

Invalidates is what changing the value marks dirty, which decides how much work the next frame does. Paint repaints the node. Layout re-runs layout for the box and whatever depends on it. Content remeasures text. Transform moves what is already painted. Semantics republishes the accessibility record. Properties marks the value changed without scheduling any of those, for something the input or paint layer reads on demand. None means the runtime does no work at all, and something else reads the value when it needs it.

The groups are editorial. Within a group the order is the order the registry declares them in.

Size ​

What a box asks for. Nothing here is a promise: a min or a max, a parent, or the content can all overrule it.

PropertyDefaultInheritedInvalidatesWhat it does
widthunsetnoLayoutRequested width, as a number of pixels or a length.
heightunsetnoLayoutRequested height, as a number of pixels or a length.
minWidthunsetnoLayoutFloor on the width, applied after everything else has had its say.
maxWidthunsetnoLayoutCeiling on the width. Beats width, loses to minWidth.
minHeightunsetnoLayoutFloor on the height.
maxHeightunsetnoLayoutCeiling on the height.
aspectRatiounsetnoLayoutWidth divided by height. Fills in whichever of the two is not otherwise decided.

Spacing ​

Space inside the box, space outside it, and space between children.

PropertyDefaultInheritedInvalidatesWhat it does
paddingunsetnoLayoutSpace inside the border on all four sides. A number, never a tuple.
paddingXunsetnoLayoutSpace inside the border, left and right. The idiom, over a pair of sides.
paddingYunsetnoLayoutSpace inside the border, top and bottom. The idiom, over a pair of sides.
paddingTopunsetnoLayoutOverrides paddingY on the top edge. For one edge, not for an axis.
paddingRightunsetnoLayoutOverrides paddingX on the right edge. For one edge, not for an axis.
paddingBottomunsetnoLayoutOverrides paddingY on the bottom edge. For one edge, not for an axis.
paddingLeftunsetnoLayoutOverrides paddingX on the left edge. For one edge, not for an axis.
paddingStartunsetnoLayoutSpace inside the border on the edge the reading starts at. The idiom for one horizontal edge.
paddingEndunsetnoLayoutSpace inside the border on the edge the reading ends at. The idiom for one horizontal edge.
marginunsetnoLayoutSpace outside the box on all four sides. Margins do not collapse.
marginXunsetnoLayoutSpace outside the box, left and right. The idiom, over a pair of sides.
marginYunsetnoLayoutSpace outside the box, top and bottom. The idiom, over a pair of sides.
marginTopunsetnoLayoutOverrides marginY on the top edge. For one edge, not for an axis.
marginRightunsetnoLayoutOverrides marginX on the right edge. For one edge, not for an axis.
marginBottomunsetnoLayoutOverrides marginY on the bottom edge. For one edge, not for an axis.
marginLeftunsetnoLayoutOverrides marginX on the left edge. For one edge, not for an axis.
marginStartunsetnoLayoutSpace outside the box on the edge the reading starts at. The idiom for one horizontal edge.
marginEndunsetnoLayoutSpace outside the box on the edge the reading ends at. The idiom for one horizontal edge.
gapunsetnoLayoutSpace between children, on both axes.
rowGapunsetnoLayoutOverrides gap between rows.
columnGapunsetnoLayoutOverrides gap between columns.

Flex ​

How a row or a column arranges its children, and how a child answers back.

PropertyDefaultInheritedInvalidatesWhat it does
flexunsetnoLayoutThe CSS shorthand: flex={n} is grow n, shrink 1, basis 0.
flexWrapunsetnoLayoutWhether children that do not fit start a new line.
alignContentunsetnoLayoutHow a wrapping container distributes its lines on the cross axis, and a grid its row tracks.
layoutunsetnoLayoutA layout the application wrote itself, which measures and places this node's children.
layoutDataunsetnoLayoutA value carried to the custom layout that arranges this node.
baselineunsetnoLayoutThe baseline a node declares, in pixels from its top, for content the layout cannot read one from, as a painted figure or math. A row aligned on baselines lines it up with the text beside it.
flexGrowunsetnoLayoutShare of the space left over that this child takes.
flexShrinkunsetnoLayoutShare of any shortfall this child gives up. Defaults to 1 in a flex container.
flexBasisunsetnoLayoutThe size grow and shrink start from, before either applies.
xunsetnoLayoutAlignment of children along the x axis. Axis-relative, so it does not flip with direction.
yunsetnoLayoutAlignment of children along the y axis. Axis-relative, so it does not flip with direction.
selfXunsetnoLayoutOne child overriding the x alignment its parent set.
selfYunsetnoLayoutOne child overriding the y alignment its parent set.
directionunsetnoLayoutWhich way a flex or scroll container runs.

Grid ​

Track definitions on the container, placement on the item.

PropertyDefaultInheritedInvalidatesWhat it does
columnsunsetnoLayoutThe column tracks, as a list of sizes.
rowsunsetnoLayoutThe row tracks, as a list of sizes.
autoColumnsunsetnoLayoutSize for columns the grid creates beyond the declared ones.
autoRowsunsetnoLayoutSize for rows the grid creates beyond the declared ones.
subgridunsetnoLayoutA nested grid taking its column tracks from the span it occupies in its parent. Column axis only.
autoFlowunsetnoLayoutWhich axis unplaced items fill first.
justifyContentunsetnoLayoutHow the column tracks are distributed when they do not fill the container.
columnunsetnoLayoutThe column line this item starts at, counting from 1.
columnSpanunsetnoLayoutHow many columns the item covers.
rowunsetnoLayoutThe row line this item starts at, counting from 1.
rowSpanunsetnoLayoutHow many rows the item covers.

Position ​

Taking a box out of flow, and putting it somewhere specific instead.

PropertyDefaultInheritedInvalidatesWhat it does
positionunsetnoLayoutOne of static, relative, absolute, sticky. Anything but static makes a containing block.
topunsetnoLayoutOffset from the top edge of the containing block.
rightunsetnoLayoutOffset from the right edge.
bottomunsetnoLayoutOffset from the bottom edge.
leftunsetnoLayoutOffset from the left edge.
zIndexunsetnoLayoutPaint and hit-test order among siblings; higher paints later and is hit first.
liftunsetnoLayoutPaints this node above the tree and outside every clip its ancestors impose, keeping their transforms and scrolling. For a shared element morphing into something that clips; see sharedElement.
liftBoundaryunsetnoLayoutHow far a lifted descendant rises: to the end of this node rather than the end of the frame. Presence marks every layer with it, so a lift is held to its own screen.
anchorunsetnoLayoutThe node an absolute box is placed beside. Flips and shifts to stay inside its containing block.
placementunsetnoLayoutWhich side of the anchor to sit on, and how to align along it.
anchorPointunsetnoLayoutA point an absolute box is placed beside, for a menu opened where the pointer is. Flips and shifts as anchor does, so a point near an edge opens back towards the screen rather than off it.
anchorRectunsetnoLayoutA rectangle in the anchor's own coordinates to sit beside instead of the whole anchor, such as one character in a field. Flips, shifts and follows the anchor as anchor does.
anchorOffsetunsetnoLayoutGap between the anchor and the anchored box.
insetunsetnoLayoutShorthand for top, right, bottom and left at once.

Overflow and scrolling ​

Clipping, scroll containers, and what a wheel does when it reaches the end.

PropertyDefaultInheritedInvalidatesWhat it does
overflowunsetnoPaint, Layoutvisible, hidden, or scroll and auto, which make the box a scroll container.
scrollbarsunsetnoPaint, Layoutauto (the default) shows a scroll container's overlay scrollbars while it scrolls; none never shows them, for a container scrolled by something else.
scrollXunsetnoTransformCurrent horizontal scroll offset. Readable and writable.
scrollBehaviorunsetnoNoneWhether a wheel moves this container at once or animates it. Read by input, not by layout.
scrollYunsetnoTransformCurrent vertical scroll offset. Readable and writable.
scrollWithunsetnoLayout, TransformAnother node whose scroll offset this container takes, in the same frame. A gutter beside a field.
scrollWithAxisunsetnoTransformWhich axes scrollWith follows: both (the default), x or y.
overscrollBehaviorunsetnoNoneWhat happens to a wheel delta this node cannot use: chain it to an ancestor, or keep it.

Paint ​

Fills, borders, shadows and everything else that changes pixels without changing boxes.

PropertyDefaultInheritedInvalidatesWhat it does
backgroundColorunsetnoPaintFill behind the content. Takes a theme token as well as a colour.
backgroundGradientunsetnoPaintA gradient over the background colour and under the image. Built with linearGradient or radialGradient. A numeric stop offset is a pixel length along the ramp, not a fraction of it; a fraction is percent(45), and a gradient whose numeric offsets all lie within 0 to 1 is refused.
borderColorblacknoPaintColour of the border, drawn inside the box.
borderWidthunsetnoPaintThickness of that border, in pixels.
borderRadiusno roundingnoPaintCorner rounding: one number, four, or a name in the theme's shape scale (borderRadius="medium"), resolved at paint against the theme the element is under. Clips the background, the image and overflow: hidden.
opacity1noPaintApplies to the whole subtree, not just this node.
boxShadowsnonenoPaintCSS box-shadows: outside the box, or inside it with inset, following its corner radius. The first is on top. A colour may be a palette name, and the whole may be a size on the theme's shadow scale (boxShadows="medium"), resolved against the theme the element is under. Painted outside the node's own clip, and a node is culled only once its shadows are off screen too.
visibletruenoPaint, SemanticsHides the box and its subtree without taking it out of layout.
transformunsetnoPaint, TransformTranslation, scale and rotation applied at paint time. Layout does not see it.
rasterizefalsenoPaintKeeps the subtree as pixels and copies them while only what is above it moves or scales, as a camera does. Canvas2D only; drawn again when anything in it changes.
holdUnseenunsetnoPropertiesHolds the subtree as it last was while it is out of view, or with belowScale drawn smaller than that share of its size: changes inside wait, and it catches up the frame it can be read again. For a board of many live screens.
paintunsetnoPaint, LayoutA painter given a drawing surface, the resolved box and the device scale, with the inputs it reads. Repainted when those change and not otherwise.
pathunsetnoPaintA static vector shape, with its own fill rule, stroke, dash, caps and joins.
clipPathunsetnoPaintClips this node to a path, in the same vocabulary path takes.
blurunsetnoPaintBlurs a painted node's own picture, in pixels. Not a backdrop blur.

Text ​

The text style properties are the inherited ones. Set them on a container and everything below reads them.

PropertyDefaultInheritedInvalidatesWhat it does
colorblackyesPaintText colour. Inherited by text that sets none, unless a nearer textStyle provides its own, and a theme token resolves against the theme where the text is painted.
fontFamilysystem-ui, sans-serifyesPaint, LayoutFont stack, as a CSS family list.
fontSize14yesPaint, LayoutSize in pixels.
fontWeightnormalyesPaint, LayoutA number, a numeric string, or a CSS keyword.
lineHeight20yesPaint, LayoutLine box height in pixels. The default is the body line, 20 on 14; a node that sets its own fontSize alone gets 1.2 times it, and so does the text below it.
letterSpacing0yesPaint, LayoutExtra space between characters, in pixels.
textAlignstartyesPaintHow lines sit within the text box.
textDirectionltryesPaintBase direction for bidirectional text.
fontStylenormalyesPaint, LayoutUpright or sloped: normal, italic or oblique.
fontStretchnormalyesPaint, LayoutThe width axis, as CSS keywords. Reaches a variable font's wdth.
fontVariantnormalyesPaint, LayoutThe one variant a canvas font string carries: normal or small-caps.
fontKerningautoyesPaint, LayoutWhether the shaper applies the font's kerning pairs.
textDecorationnoneyesPaintLines drawn with the text: underline, line-through, or both. Paint only.
spansunsetnoContent, Layout, SemanticsThe paragraph as runs of { text, style } instead of one string. Set instead of text: the runs concatenated are the text, so offsets mean the same thing either way.
verticalAlignunsetnoPaintHow a text run sits against the baseline of its line.
textWrapunsetnoPaint, LayoutHow text breaks into lines: word, char, or none.
maxLinesunsetnoPaint, LayoutLines kept before the rest is dropped. Pairs with textOverflow.
textOverflowunsetnoPaint, LayoutWhat happens to a line that does not fit: clip or ellipsis.
textunsetnoContent, Layout, SemanticsThe string a text node draws. Changing it remeasures and relayouts.

Editing ​

The properties an editable node adds. Set by TextInput and TextArea; usable directly.

PropertyDefaultInheritedInvalidatesWhat it does
valueunsetnoContent, Layout, SemanticsThe text of an editable node. Write the reported value back to get a controlled field.
placeholderunsetnoPaint, LayoutShown while the value is empty.
multilineunsetnoPropertiesWhether Enter inserts a newline or is left for the app.
readOnlyunsetnoPropertiesSelectable and focusable, but not editable.
secretunsetnoPaint, Layout, SemanticsA password field: drawn as bullets, copies nothing, and is edited through a password input. Single-line.
caretColorunsetnoPaintColour of the caret. Falls back to the text colour.
selectionColorunsetnoPaintFill behind selected text.
matchColorunsetnoPaintFill behind a find match.
placeholderColorunsetnoPaintColour of the placeholder text.
editorunsetnoPropertiesThe editable text model backing this node, when the app supplies its own.

Interaction ​

Whether a node can be hit, focused, selected, or used at all.

PropertyDefaultInheritedInvalidatesWhat it does
cursorunsetnoPropertiesCSS cursor shown over this node. Resolved on hover and applied to the canvas by the shell.
selectableunsetnoPropertiesWhether the pointer may select text in this subtree. Read up the ancestor chain, like user-select.
editingGroupunsetnoPropertiesMakes the editables inside select as one, with edits over a selection across them going to onEdit. See text editing.
textInputunsetnoPropertiesMakes the node a surface that keeps its own text: typed text, IME composition and the clipboard reach it as events through the editing proxy. See text editing.
pointerEventsunsetnoPropertiesWhether the node takes pointer input, or lets it through to what is behind.
touchEmulationunsetnoPropertiesTakes a mouse over the subtree as a finger: no hover without a press, hover dropped when it lifts, as a browser device mode does.
focusableunsetnoPropertiesWhether focus can land here at all, by tab, by click or by focus().
tabStopunsetnoPropertiesWhether Tab stops here. false keeps a focusable container out of the cycle, as tabindex="-1" does.
disabledunsetnoProperties, SemanticsBlocks input and publishes the disabled state to the mirror.
hitTestableunsetnoPropertiesWhether hit testing considers this node at all.
visualStatenormalnoPaintHover, press, focus, disabled. Written by interactive and read by whatever paints.

Semantics ​

What the node publishes to the accessibility mirror, since a canvas has no DOM to read.

PropertyDefaultInheritedInvalidatesWhat it does
roleunsetnoSemanticsWhat the node is, as far as assistive technology is concerned. Validated on write.
labelunsetnoSemanticsThe accessible name.
descriptionunsetnoSemanticsLonger detail, read after the name.
liveunsetnoSemanticsA live region: polite or assertive. Its text is announced when it changes.
statesunsetnoSemanticsChecked, expanded, busy, and the rest. Validated on write.
valueNowunsetnoSemanticsCurrent value of a range widget.
valueMinunsetnoSemanticsLowest value that range accepts.
valueMaxunsetnoSemanticsHighest value that range accepts.
valueTextunsetnoSemanticsA human reading of the value, where the number alone would not do.
posInSetunsetnoSemanticsWhich item in a set this is, counting from 1.
setSizeunsetnoSemanticsHow many items the set holds, including any not built yet.
activeDescendantunsetnoSemanticsThe node that's active while this one keeps focus, such as a combobox's highlighted option. Read as if it had focus.
controlsunsetnoSemanticsThe node this one shows or changes, such as the list a combobox's field has open.
autocompleteunsetnoSemanticsWhat a field offers as it is typed into: list, inline or both.
orientationunsetnoSemanticsWhich way a tablist, toolbar, list or separator runs, when not the way its role assumes: a column of tabs is vertical.
levelunsetnoSemanticsHow deep a tree item sits, 1 for a root. A tree is a flat list of rows, so nothing else carries this.
rowIndexunsetnoSemanticsA row's place among all its grid's rows, counting from 1 and counting the ones not mounted. Set on the row.
columnIndexunsetnoSemanticsA cell's place among all its grid's columns, counting from 1 and counting the ones not mounted.
rowCountunsetnoSemanticsHow many rows a grid or table holds in all, or -1 when not known.
columnCountunsetnoSemanticsHow many columns a grid or table holds in all, or -1 when not known.

Media ​

Bitmaps and video frames, both resolved on the shell thread and drawn inside the box.

PropertyDefaultInheritedInvalidatesWhat it does
imageunsetnoPaintA decoded bitmap drawn inside the box, clipped by borderRadius.
videounsetnoPaintA video surface drawn where an image would be, under the same fit and clip.
srcunsetnoNoneThe URL an Image loaded its picture from, for tools that read the tree; nothing draws it.
objectFitunsetnoPaintHow that bitmap or surface fills the box: fill, cover, contain, none.

Virtualization ​

What a virtualized container writes on its rows so the runtime can reason about the ones it cannot see.

PropertyDefaultInheritedInvalidatesWhat it does
virtualIndexunsetnoPropertiesWhich item in the full list this mounted row is.
virtualLeadunsetnoPropertiesSpace standing in for the rows above the window.
virtualWindowunsetnoPropertiesThe range currently built, and the estimate for everything outside it.
virtualSheetunsetnoPropertiesMarks the surface a LazySheet windows on both axes, and carries the geometry it was given.

Environment ​

Values provided at one node and inherited by everything under it.

PropertyDefaultInheritedInvalidatesWhat it does
themeunsetnoEnvironmentProvides a palette and a type scale to this subtree.
pointerunsetnoEnvironmentSays this subtree is used with a finger (coarse) or a mouse (fine), over the device; a coarse theme grows its controls.
textStyleunsetnoEnvironmentProvides one step of the type scale as the inherited text style.
contentColorunsetnoEnvironmentProvides the colour that content on this surface should use.
provideunsetnoEnvironmentProvides values for keys made with createEnvironmentKey; a component reads one with ctx.environment(key).
containerSizeunsetnoEnvironmentDeclares this node a size query container and provides its content size to the subtree.
insetsunsetnoEnvironmentProvides the registry a floating bar publishes into and a page reads.

Next ​

The API index is the other generated page: the names an application imports, rather than the properties it sets.