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

The TILE component

In this learning path we build one screen: a list of contacts beside the selected person’s details, with a toolbar to add, edit and delete them. This page explains what a TILE component is, and shows the screen finished.

A component library often gives you one Dialog component, and you shape it with props. A TILE component is a namespace of parts instead:

  • A part is one element of the component, such as Dialog.Trigger, Dialog.Content or Dialog.Title.
  • A namespace is the object that holds a component’s parts, such as Dialog. You import each namespace from its own entry point of @dxos/react-ui, such as @dxos/react-ui/Dialog.

Dialog.Root holds the state, and each other part renders one element. You put the parts together in JSX, in the shape you want, and leave out the ones you don’t need:

import * as
import Button
Button
from '@dxos/react-ui/Button';
import * as
import Dialog
Dialog
from '@dxos/react-ui/Dialog';
import * as
import Field
Field
from '@dxos/react-ui/Field';
import * as
import Input
Input
from '@dxos/react-ui/Input';
export const
const EditDialog: () => React.JSX.Element
EditDialog
= () => (
<
import Dialog
Dialog
.
function Root({ lazyMount, unmountOnExit, closeOnInteractOutside, placement, ...props }: Dialog.RootProps): React.JSX.Element
export Root
Root
>
<
import Dialog
Dialog
.
const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>
export Trigger

Use asChild to open the dialog from a Button.

Trigger
PolymorphicProps.asChild?: boolean | undefined

Use the provided child element as the default rendered element, combining their props and behavior.

asChild
>
<
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
>Edit contact</
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
>
</
import Dialog
Dialog
.
const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>
export Trigger

Use asChild to open the dialog from a Button.

Trigger
>
<
import Dialog
Dialog
.
const Content: React.ForwardRefExoticComponent<Omit<DialogContentProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
size?: Size;
container?: React.RefObject<HTMLElement | null>;
placement?: Dialog.Placement;
scrim?: boolean;
closeOnInteractOutside?: boolean;
} & React.RefAttributes<HTMLDivElement>>
export Content

Portalled surface at level='raised' over a scrim, centred in the viewport: a column of Header, Body and Footer.

Content
>
<
import Dialog
Dialog
.
const Header: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLDivElement>>
export Header

A block row holding the Title and an optional trailing CloseTrigger.

Header
>
<
import Dialog
Dialog
.
const Title: React.ForwardRefExoticComponent<Omit<DialogTitleProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLHeadingElement>>
export Title
Title
>Edit contact</
import Dialog
Dialog
.
const Title: React.ForwardRefExoticComponent<Omit<DialogTitleProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLHeadingElement>>
export Title
Title
>
<
import Dialog
Dialog
.
const CloseTrigger: React.ForwardRefExoticComponent<Omit<DialogCloseTriggerProps, "children"> & {
children?: React.ReactNode;
icon?: string;
label?: string;
} & React.RefAttributes<HTMLButtonElement>>
export CloseTrigger
CloseTrigger
/>
</
import Dialog
Dialog
.
const Header: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLDivElement>>
export Header

A block row holding the Title and an optional trailing CloseTrigger.

Header
>
<
import Dialog
Dialog
.
const Body: React.ForwardRefExoticComponent<Omit<Pick<ScrollArea.RootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<Layout.ContainerProps, "gap"> & {
align?: "start" | "center";
children?: React.ReactNode;
} & React.RefAttributes<HTMLDivElement>>
export Body

Composed scroll (decision 5): a gutter='md' Container as the viewport, so the thumb sits in the end gutter; gap spaces its rows, since they are the Container's own items. The element carries ScrollArea's data-scope, since parts cannot rescope a composed child (finding 10).

Body
>
<
import Dialog
Dialog
.
const Description: React.ForwardRefExoticComponent<Omit<DialogDescriptionProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLParagraphElement>>
export Description
Description
>
Changes are saved when you press Save.
</
import Dialog
Dialog
.
const Description: React.ForwardRefExoticComponent<Omit<DialogDescriptionProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLParagraphElement>>
export Description
Description
>
<
import Field
Field
.
const Root: React.ForwardRefExoticComponent<Omit<FieldRootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
validationValence?: Field.Valence;
layout?: "stack" | "row" | "inline";
level?: Layout.Level;
span?: Layout.Span;
tone?: "muted";
} & React.RefAttributes<HTMLDivElement>>
export Root

A part, not a container (decision 13): a flex stack in the content track with the label above its control.

Root
>
<
import Field
Field
.
const Label: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLLabelElement>>
export Label

Names the control; while the root is required it ends with the required indicator, unless a RequiredIndicator among its children places the mark itself.

Label
>Name</
import Field
Field
.
const Label: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLLabelElement>>
export Label

Names the control; while the root is required it ends with the required indicator, unless a RequiredIndicator among its children places the mark itself.

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

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
defaultValue?: string | number | readonly string[] | undefined
defaultValue
='Ada Lovelace' />
</
import Field
Field
.
const Root: React.ForwardRefExoticComponent<Omit<FieldRootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
validationValence?: Field.Valence;
layout?: "stack" | "row" | "inline";
level?: Layout.Level;
span?: Layout.Span;
tone?: "muted";
} & React.RefAttributes<HTMLDivElement>>
export Root

A part, not a container (decision 13): a flex stack in the content track with the label above its control.

Root
>
</
import Dialog
Dialog
.
const Body: React.ForwardRefExoticComponent<Omit<Pick<ScrollArea.RootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<Layout.ContainerProps, "gap"> & {
align?: "start" | "center";
children?: React.ReactNode;
} & React.RefAttributes<HTMLDivElement>>
export Body

Composed scroll (decision 5): a gutter='md' Container as the viewport, so the thumb sits in the end gutter; gap spaces its rows, since they are the Container's own items. The element carries ScrollArea's data-scope, since parts cannot rescope a composed child (finding 10).

Body
>
<
import Dialog
Dialog
.
const Footer: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLDivElement>>
export Footer

An end-justified Group of actions; the child div wins the merge, so the part keeps the dialog scope. The actions stay regular-sized in a small dialog, since they are the dialog's primary targets.

Footer
>
<
import Dialog
Dialog
.
const CloseTrigger: React.ForwardRefExoticComponent<Omit<DialogCloseTriggerProps, "children"> & {
children?: React.ReactNode;
icon?: string;
label?: string;
} & React.RefAttributes<HTMLButtonElement>>
export CloseTrigger
CloseTrigger
asChild?: boolean | undefined

Use the provided child element as the default rendered element, combining their props and behavior.

asChild
>
<
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
>Cancel</
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
>
</
import Dialog
Dialog
.
const CloseTrigger: React.ForwardRefExoticComponent<Omit<DialogCloseTriggerProps, "children"> & {
children?: React.ReactNode;
icon?: string;
label?: string;
} & React.RefAttributes<HTMLButtonElement>>
export CloseTrigger
CloseTrigger
>
<
import Dialog
Dialog
.
const CloseTrigger: React.ForwardRefExoticComponent<Omit<DialogCloseTriggerProps, "children"> & {
children?: React.ReactNode;
icon?: string;
label?: string;
} & React.RefAttributes<HTMLButtonElement>>
export CloseTrigger
CloseTrigger
asChild?: boolean | undefined

Use the provided child element as the default rendered element, combining their props and behavior.

asChild
>
<
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
variant?: Button.Variant | undefined
variant
='primary'>Save</
import Button
Button
.
const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & {
classNames?: ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLButtonElement>>
export Root
Root
>
</
import Dialog
Dialog
.
const CloseTrigger: React.ForwardRefExoticComponent<Omit<DialogCloseTriggerProps, "children"> & {
children?: React.ReactNode;
icon?: string;
label?: string;
} & React.RefAttributes<HTMLButtonElement>>
export CloseTrigger
CloseTrigger
>
</
import Dialog
Dialog
.
const Footer: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLDivElement>>
export Footer

An end-justified Group of actions; the child div wins the merge, so the part keeps the dialog scope. The actions stay regular-sized in a small dialog, since they are the dialog's primary targets.

Footer
>
</
import Dialog
Dialog
.
const Content: React.ForwardRefExoticComponent<Omit<DialogContentProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
size?: Size;
container?: React.RefObject<HTMLElement | null>;
placement?: Dialog.Placement;
scrim?: boolean;
closeOnInteractOutside?: boolean;
} & React.RefAttributes<HTMLDivElement>>
export Content

Portalled surface at level='raised' over a scrim, centred in the viewport: a column of Header, Body and Footer.

Content
>
</
import Dialog
Dialog
.
function Root({ lazyMount, unmountOnExit, closeOnInteractOutside, placement, ...props }: Dialog.RootProps): React.JSX.Element
export Root
Root
>
);

Dialog.Trigger wraps the button that opens the dialog. Each button in the footer sits in a Dialog.CloseTrigger, so Cancel and Save both close it.

Every part takes its look from the theme, which is TILE’s stylesheets and the tokens they are built from. A token is a named color or size. A part writes its props, such as variant='primary', onto its element as attributes, and the stylesheets style them with tokens.

The same component therefore follows light and dark mode, and matches the rest of the app. To adjust one part, pass classNames. Theme.Provider wraps the app and gives the parts their built-in strings and their icons.

The parts also handle the keyboard, focus and ARIA attributes. A dialog traps focus and closes on Escape without code of yours.

Composite components covers parts and the state machines behind them. Theme and tokens covers the tokens and classNames.

This is the screen at the end of the path, before its last page moves the contacts into ECHO, DXOS’s database. Select a contact, edit it, delete it or add one:

Each page of the path builds one piece of it. From Lay out a screen on, each page keeps its version of the screen in a folder of its own:

Page Folder What it adds
Installation src/ A Vite app with TILE’s theme, icons and dark mode, and its first buttons
Lay out a screen src/layout/ The list beside the detail, with a toolbar
Inputs and actions src/inputs/ An editor for the selected contact
Overlays src/overlays/ An edit dialog, a delete confirmation, a tooltip and a toast
Icons and translations src/icons/ Icons, an Add button, and the screen’s strings in a resource
Connect to ECHO src/echo/ The contacts as ECHO objects that sync, and a form built from their schema

Every page before Connect to ECHO keeps the contacts in React state, so the only new thing on each page is TILE.