Every TILE control takes its height, text size, icon size and spacing from one scale with five steps: xs, sm, md,
lg and xl. When you set a size on an element, the controls inside it follow.
To make one toolbar compact by hand, you override the height and the padding of every control in it. With TILE, you
set the size once, on the toolbar, and the controls inside read it.
Density is how compact a region’s controls are, and a size is the step of the scale that sets it. A smaller
size makes the controls shorter, with smaller text, smaller icons and narrower gaps.
A size is an attribute. A component that takes a size prop sets data-size on its element. The theme defines,
for each step, variables such as --dx-block-size (a control’s height), --dx-font-size, --dx-icon-size and
--dx-gap-size. Every control reads these variables instead of fixed values.
Sizes inherit. A control without its own size uses the nearest one above it. Panel.Root, Toolbar.Root,
Layout.Container, a field header, a dialog and a button all take size. Outside any of them, controls use md.
One-axis layout box: the primitive that replaces hand-written flex … wrapper divs.
gap is restricted to the named steps of the theme spacing ramp (see
Gap
), which is the
point of the prop — an off-ramp gap-2/gap-3 literal in a container is the drift it prevents.
Anything the props don't cover (padding, sizing, overflow, colour) goes through classNames; the
component deliberately grows no padding or colour props, since components own their own spacing.
There is no implicit align. Row-centering is the common case, but defaulting it would silently
restyle any consumer relying on the CSS stretch initial value.
Use asChild to project the layout onto a semantic element (<header>, <ul>, <a>).
@example
<Flex column gap='sm'>…</Flex>
<Flex gap='sm' justify='end'>…</Flex>
<Flex center classNames='h-full text-fg-subtle' role='status'>{t('empty.message')}</Flex>
Flex
column?: boolean | undefined
Stack on the block axis instead of the inline axis.
Calls a defined callback function on each element of an array, and returns an array that contains the results.
@param ― callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
@param ― thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
role=toolbar with the roving focus that role promises (decision 9); items that overflow scroll along its axis in a
thin ScrollArea whose bar shows on hover, the toolbar itself being the viewport.
Text input at control size; inside a Field.Root it takes the field's id, label and description wiring. With
start or end it renders a ControlFrame holding the adornments and a bare input; data-testid and classes then
go to the frame, the ref to the input.
Root
placeholder?: string | undefined
placeholder={`Search (${
size: "sm" | "md" | "lg"
size})`}
"aria-label"?: string | undefined
Defines a string value that labels the current element.
role=toolbar with the roving focus that role promises (decision 9); items that overflow scroll along its axis in a
thin ScrollArea whose bar shows on hover, the toolbar itself being the viewport.
One-axis layout box: the primitive that replaces hand-written flex … wrapper divs.
gap is restricted to the named steps of the theme spacing ramp (see
Gap
), which is the
point of the prop — an off-ramp gap-2/gap-3 literal in a container is the drift it prevents.
Anything the props don't cover (padding, sizing, overflow, colour) goes through classNames; the
component deliberately grows no padding or colour props, since components own their own spacing.
There is no implicit align. Row-centering is the common case, but defaulting it would silently
restyle any consumer relying on the CSS stretch initial value.
Use asChild to project the layout onto a semantic element (<header>, <ul>, <a>).
@example
<Flex column gap='sm'>…</Flex>
<Flex gap='sm' justify='end'>…</Flex>
<Flex center classNames='h-full text-fg-subtle' role='status'>{t('empty.message')}</Flex>
Flex>
16
);
17
Toolbar.Root is the only component here that takes a size. The buttons and the input inside it name none, so
each row of controls follows its toolbar.
An overlay takes the size of its trigger. For example, a popover opened from a sm toolbar is sm too, though the
popover renders in a portal outside the toolbar.
A menu is the exception. It is md wherever it opens, and a submenu takes the size of the menu it opens from.
An overlay’s content can name its own size to break from its trigger. Use this for a dialog that should be lg
wherever it opens.
Labels read one text step below the body at the same size, and helper text one step below that.