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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQAumujy5kXaOKurr6zgTP2krHrFVXi2kj8seRYrlvq2GssUjReh5MiVpQbLFQNy9HsmcasqpBNVsXytWTw0ZDjA=

Layout

TILE lays out a screen with a few components instead of hand-written flex and grid classes. A Panel is the shell of a pane, ScrollArea makes its body scroll, and the layout primitives, such as Flex, Grid and Container, arrange what is inside.

A pane with a fixed header and a scrolling body is easy to get wrong by hand. It takes a flex column, a min-height: 0 and an overflow, each on the right element, and if you miss one, the whole page scrolls where the pane should. With TILE, you compose the pane from a panel and a scroll area instead.

A panel has three rows. Panel.Root is a grid whose rows are Panel.Header, Panel.Body and Panel.Footer. The header and footer take the height of their content, and the body takes the rest.

Use a panel as the outer shell of a pane. It fills its parent, so its parent needs a height.

The height chain. The height chain is the run of elements from the panel down to the content that scrolls. For the body to scroll, each of them must pass its height down.

Panel.Body asChild makes the ScrollArea.Root the body itself, and ScrollArea.Viewport asChild makes the content the viewport. This way, no extra element breaks the chain.

Example (Building a panel with a scrolling body)

import * as
import Button
Button
from '@dxos/react-ui/Button';
import * as
import Icon
Icon
from '@dxos/react-ui/Icon';
import * as
import Layout
Layout
from '@dxos/react-ui/Layout';
import * as
import Panel
Panel
from '@dxos/react-ui/Panel';
import * as
import ScrollArea
ScrollArea
from '@dxos/react-ui/ScrollArea';
import * as
import Toolbar
Toolbar
from '@dxos/react-ui/Toolbar';
import * as
import Typography
Typography
from '@dxos/react-ui/Typography';
export const
const ContactsPanel: () => React.JSX.Element
ContactsPanel
= () => (
<
import Panel
Panel
.
const Root: React.ForwardRefExoticComponent<Omit<Panel.RootProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Root

The plank host: fills its parent, sets data-size and a level for its subtree, and is the pane's query container, so its header, body and footer collapse at the same pane width.

Root
>
<
import Panel
Panel
.
const Header: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Header

The top row on the bar aspect, which steps off whatever level hosts the panel; it sizes to its content, so it takes no space when empty and one block when it holds a Toolbar.Root.

Header
>
<
import Toolbar
Toolbar
.
const Root: React.ForwardRefExoticComponent<Omit<Toolbar.RootProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Root

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.

Root
>
<
import Toolbar
Toolbar
.
const Text: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Text

A run of text that takes the free space and truncates; not an item, so roving focus skips it.

Text
>Contacts</
import Toolbar
Toolbar
.
const Text: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Text

A run of text that takes the free space and truncates; not an item, so roving focus skips it.

Text
>
<
import Toolbar
Toolbar
.
const Separator: React.ForwardRefExoticComponent<Omit<Toolbar.SeparatorProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Separator

A rule across the toolbar's axis (vertical in a horizontal toolbar), or with variant='gap' a growing spacer; not an item, so roving focus skips it.

Separator
variant?: "gap" | "line" | undefined

gap is an empty spacer that grows, pushing the items after it to the toolbar's end.

variant
='gap' />
<
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
icon?: string | undefined

Leading icon.

icon
='ph--plus--regular'
label?: string | undefined

Visible text; children take precedence.

Required: names the button (aria-label) and shows in a Tooltip.

label
='Add contact'
iconOnly?: boolean | undefined

A control-sized square inset in a block-sized cell (follow-up 19), showing only the icon.

iconOnly
/>
</
import Toolbar
Toolbar
.
const Root: React.ForwardRefExoticComponent<Omit<Toolbar.RootProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Root

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.

Root
>
</
import Panel
Panel
.
const Header: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Header

The top row on the bar aspect, which steps off whatever level hosts the panel; it sizes to its content, so it takes no space when empty and one block when it holds a Toolbar.Root.

Header
>
<
import Panel
Panel
.
const Body: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Body

The growing middle row, a plain slot: it neither scrolls nor adds a gutter, so content composes its own frame (asChild onto a ScrollArea.Root around a Container, or a canvas that fills the row). The first Container under it takes the panel's gutter unless it names one. Like the header and footer it is no query container, so its content collapses against the panel.

Body
asChild?: boolean | undefined
asChild
>
<
import ScrollArea
ScrollArea
.
const Root: React.ForwardRefExoticComponent<Omit<ScrollArea.RootProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Root

Non-scrolling frame: hosts the overlay thumbs and is the query container for its content.

Root
>
<
import ScrollArea
ScrollArea
.
const Viewport: React.ForwardRefExoticComponent<Omit<ScrollArea.ViewportProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Viewport

The scrolling element; under asChild it is the child (e.g. a Container) itself.

Viewport
asChild?: boolean | undefined
asChild
>
<
import Layout
Layout
.
const Container: React.ForwardRefExoticComponent<Omit<Layout.ContainerProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

Grid part (decision 5): every prop is a data-* attribute resolved by theme/container.css.

Container
gutter?: Layout.Gutter | undefined

inherit makes the container a subgrid of its parent's tracks; any other value starts a fresh template. Unset, it is the enclosing Panel.Body's gutter for the first Container under the Body, and inherit everywhere else.

gutter
='rail'>
{
const CONTACTS: string[]
CONTACTS
.
Array<string>.map<React.JSX.Element>(callbackfn: (value: string, index: number, array: string[]) => React.JSX.Element, thisArg?: any): React.JSX.Element[]

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.

map
((
name: string
name
) => (
<
import Layout
Layout
.
const Container: React.ForwardRefExoticComponent<Omit<Layout.ContainerProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

Grid part (decision 5): every prop is a data-* attribute resolved by theme/container.css.

Container
React.Attributes.key?: React.Key | null | undefined
key
={
name: string
name
}
layout?: "row" | "stack" | undefined

stack places each child across the content track; row flows children through its inner tracks.

layout
='row'>
<
import Layout
Layout
.
const Block: React.ForwardRefExoticComponent<Omit<Layout.BlockProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

A block-sized square that centres its content (typically an Icon); compact drops the fixed height.

Block
rail?: "start" | "end" | undefined

Places the block in a parent Container's start or end gutter.

rail
='start'>
<
import Icon
Icon
.
const Icon: React.ForwardRefExoticComponent<Omit<Omit<React.SVGProps<SVGSVGElement>, "ref">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
icon: string;
label?: string;
hue?: Icon.IconHue;
valence?: Icon.IconValence;
tone?: Icon.IconTone;
spin?: boolean;
size?: Size;
} & React.RefAttributes<SVGSVGElement>>
Icon
icon: string
icon
='ph--user--regular' />
</
import Layout
Layout
.
const Block: React.ForwardRefExoticComponent<Omit<Layout.BlockProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

A block-sized square that centres its content (typically an Icon); compact drops the fixed height.

Block
>
<
import Typography
Typography
.
const Text: React.ForwardRefExoticComponent<Omit<Typography.TextProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLParagraphElement>>
export Text

Text whose first line is centred in a block, so it lines up with a Block or control beside it however many lines it wraps to. Renders a <p>; asChild puts the metrics on a heading or other text element instead.

Text
>{
name: string
name
}</
import Typography
Typography
.
const Text: React.ForwardRefExoticComponent<Omit<Typography.TextProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLParagraphElement>>
export Text

Text whose first line is centred in a block, so it lines up with a Block or control beside it however many lines it wraps to. Renders a <p>; asChild puts the metrics on a heading or other text element instead.

Text
>
</
import Layout
Layout
.
const Container: React.ForwardRefExoticComponent<Omit<Layout.ContainerProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

Grid part (decision 5): every prop is a data-* attribute resolved by theme/container.css.

Container
>
))}
</
import Layout
Layout
.
const Container: React.ForwardRefExoticComponent<Omit<Layout.ContainerProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

Grid part (decision 5): every prop is a data-* attribute resolved by theme/container.css.

Container
>
</
import ScrollArea
ScrollArea
.
const Viewport: React.ForwardRefExoticComponent<Omit<ScrollArea.ViewportProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Viewport

The scrolling element; under asChild it is the child (e.g. a Container) itself.

Viewport
>
</
import ScrollArea
ScrollArea
.
const Root: React.ForwardRefExoticComponent<Omit<ScrollArea.RootProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Root

Non-scrolling frame: hosts the overlay thumbs and is the query container for its content.

Root
>
</
import Panel
Panel
.
const Body: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Body

The growing middle row, a plain slot: it neither scrolls nor adds a gutter, so content composes its own frame (asChild onto a ScrollArea.Root around a Container, or a canvas that fills the row). The first Container under it takes the panel's gutter unless it names one. Like the header and footer it is no query container, so its content collapses against the panel.

Body
>
<
import Panel
Panel
.
const Footer: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Footer

The bottom row on the bar aspect; like Header it sizes to its content, holding a Toolbar.Root when it needs one.

Footer
>
<
import Toolbar
Toolbar
.
const Root: React.ForwardRefExoticComponent<Omit<Toolbar.RootProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Root

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.

Root
>
<
import Toolbar
Toolbar
.
const Text: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Text

A run of text that takes the free space and truncates; not an item, so roving focus skips it.

Text
>{
const CONTACTS: string[]
CONTACTS
.
Array<string>.length: number

Gets or sets the length of the array. This is a number one higher than the highest index in the array.

length
} contacts</
import Toolbar
Toolbar
.
const Text: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Text

A run of text that takes the free space and truncates; not an item, so roving focus skips it.

Text
>
</
import Toolbar
Toolbar
.
const Root: React.ForwardRefExoticComponent<Omit<Toolbar.RootProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Root

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.

Root
>
</
import Panel
Panel
.
const Footer: React.ForwardRefExoticComponent<Omit<{
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Footer

The bottom row on the bar aspect; like Header it sizes to its content, holding a Toolbar.Root when it needs one.

Footer
>
</
import Panel
Panel
.
const Root: React.ForwardRefExoticComponent<Omit<Panel.RootProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>
export Root

The plank host: fills its parent, sets data-size and a level for its subtree, and is the pane's query container, so its header, body and footer collapse at the same pane width.

Root
>
);

ContactsPanel puts four parts between the panel and its rows: the body, the scroll area’s root, its viewport and a Layout.Container. The two asChild lines fold them into two elements. Each row’s icon sits in a Layout.Block, in the rail that gutter='rail' leaves.

Layout primitives. A layout primitive is one of the six components in the Layout namespace, which place content and own its spacing. Flex, Grid and Container take asChild, so you can lay out a semantic element such as a <header> or <ul> without an extra wrapper. Block, Columns and Separator do not take it. The table says what each one arranges and when to use it:

Primitive Arranges
Flex Children along one axis. Use it for a row of controls or a stack of fields. Its props are column, gap, align, justify, wrap, grow and center
Grid Children in tracks. Use it when columns must line up, or when one track has a fixed size. cols={3} gives equal columns, cols={['min', 'fill']} a label column and the rest, and cols='subgrid' the parent’s tracks
Container Content between two gutters, so rows line up with the panel’s edges. Use it for the rows of a panel’s body. gutter='rail' leaves room for an icon column
Block One slot in the rail of a Container, sized so an icon and an icon button line up. Use it for the icon at the start or the end of a row
Columns A horizontal run of as many columns as fit, which scrolls one column at a time. Use it for a drill-down, where each choice opens a column beside the last
Separator A rule between groups. Use it to part two groups of rows or of controls

A gutter is the space at the start and at the end of the rows of a Layout.Container.

gap takes steps, not numbers. Flex and Grid take gap='xs' through '2xl', plus 'form' and 'form-section' for the spacing between fields. Steps keep the spacing the same from one screen to the next. A literal such as gap-2, passed in classNames, still applies, and that screen then drifts from the rest.

  • Width and height use physical classes: w-*, h-*, min-w-* and max-h-*. A physical class names an axis of the screen, which is the same in every language.
  • Spacing that depends on the reading direction uses logical classes: ps-* and pe-* for padding, ms-* and me-* for margin, and start-* and end-* for insets. A logical class names the start or the end of a line, so it flips in a right-to-left language.
  • By default, Flex sets no align, so children stretch as they do in plain CSS.
  • grow on a Flex or Grid makes it take the slack of its parent and clip what overflows. A child that scrolls needs that from its parent, as a link in the height chain.
  • If you put a wrapper <div> between Panel.Body and the scrolling content, it breaks the height chain, and the content grows instead of scrolling. Use asChild instead.
  • Components such as forms and lists own their spacing. If you add padding around them, you double it.