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

Icons and translations

By the end of this page the screen’s own strings come from a translation resource, and the count says “1 contact” or “3 contacts” as it should. Icons mark the email and the role, and an Add button creates a contact.

Our first toolbar wrote its count as {contacts.length} contacts, which says “1 contacts” when one is left. A translation resource holds both forms of the string and picks one from the number:

  • A translation resource maps keys to strings for each language. It files them under a translation namespace, a name that keeps one screen’s keys apart from another’s. Step 1 writes ours.
  • Hooks.useTranslation(ns) returns t, which looks a key up in the user’s language. If a key has _one and _other forms, the count we pass chooses between them. Steps 2 and 3 call it.

An icon needs no import. We name it in full, as a string, such as ph--envelope--regular for Phosphor’s envelope in the regular weight. IconsPlugin finds the names in our code and puts those icons in the sprite, the one file of icons it builds.

Translations and icons explains how resources merge, and what happens to an icon whose name the build did not see.

  1. Write the resource. Use a namespace no other code uses, such as a reverse domain. as const lets TypeScript check the keys we pass to t. Add src/icons/translations.ts:

    import type * as
    import Theme
    Theme
    from '@dxos/react-ui/Theme';
    export const
    const ns: "com.example.contacts"
    ns
    = 'com.example.contacts';
    export const
    const translations: [{
    readonly 'en-US': {
    readonly "com.example.contacts": {
    readonly 'title.label': "Contacts";
    readonly 'count.label_one': "{{count}} contact";
    readonly 'count.label_other': "{{count}} contacts";
    readonly 'add.label': "Add contact";
    readonly 'edit.label': "Edit contact";
    readonly 'delete.label': "Delete contact";
    readonly 'empty.message': "Choose a contact";
    readonly 'new-contact.name': "New contact";
    readonly 'role.viewer': "Can read the contact book";
    readonly 'role.editor': "Can change contacts";
    readonly 'role.admin': "Can change contacts and who has access";
    };
    };
    }]
    translations
    = [
    {
    'en-US': {
    [
    const ns: "com.example.contacts"
    ns
    ]: {
    'title.label': 'Contacts',
    'count.label_one': '{{count}} contact',
    'count.label_other': '{{count}} contacts',
    'add.label': 'Add contact',
    'edit.label': 'Edit contact',
    'delete.label': 'Delete contact',
    'empty.message': 'Choose a contact',
    'new-contact.name': 'New contact',
    'role.viewer': 'Can read the contact book',
    'role.editor': 'Can change contacts',
    'role.admin': 'Can change contacts and who has access',
    },
    },
    },
    ] as
    type const = [{
    readonly 'en-US': {
    readonly "com.example.contacts": {
    readonly 'title.label': "Contacts";
    readonly 'count.label_one': "{{count}} contact";
    readonly 'count.label_other': "{{count}} contacts";
    readonly 'add.label': "Add contact";
    readonly 'edit.label': "Edit contact";
    readonly 'delete.label': "Delete contact";
    readonly 'empty.message': "Choose a contact";
    readonly 'new-contact.name': "New contact";
    readonly 'role.viewer': "Can read the contact book";
    readonly 'role.editor': "Can change contacts";
    readonly 'role.admin': "Can change contacts and who has access";
    };
    };
    }]
    const
    satisfies
    import Theme
    Theme
    .
    export Resource
    Resource
    [];

    count.label_one and count.label_other are two forms of one key, count.label.

  2. Mark the fields with icons. Icon.Icon draws a sprite icon at the text’s size. The role’s tooltip text now comes from the resource, keyed by the role. Add src/icons/ContactsScreen.tsx:

    import * as
    import Hooks
    Hooks
    from '@dxos/react-ui/Hooks';
    import * as
    import Icon
    Icon
    from '@dxos/react-ui/Icon';
    import * as
    import Layout
    Layout
    from '@dxos/react-ui/Layout';
    1 collapsed line
    import * as
    import Panel
    Panel
    from '@dxos/react-ui/Panel';
    import * as
    import Status
    Status
    from '@dxos/react-ui/Status';
    1 collapsed line
    import * as
    import Toolbar
    Toolbar
    from '@dxos/react-ui/Toolbar';
    import * as
    import Tooltip
    Tooltip
    from '@dxos/react-ui/Tooltip';
    import * as
    import Typography
    Typography
    from '@dxos/react-ui/Typography';
    import { type
    type Contact = {
    id: string;
    name: string;
    email: string;
    role: string;
    }
    Contact
    ,
    const CONTACTS: Contact[]
    CONTACTS
    } from '../contacts.ts';
    2 collapsed lines
    import {
    const ContactList: ({ contacts, selected, onSelect }: ContactListProps) => React.JSX.Element

    One row per contact; the list scrolls inside its own viewport.

    ContactList
    } from '../layout/ContactsScreen.tsx';
    import {
    const DeletePopover: ({ label, onDelete }: DeletePopoverProps) => React.JSX.Element
    DeletePopover
    ,
    const EditDialog: ({ label, contact, onSave }: EditDialogProps) => React.JSX.Element

    The editor from the last page, in a dialog that closes on Save.

    EditDialog
    } from '../overlays/ContactsScreen.tsx';
    import {
    const ns: "com.example.contacts"
    ns
    } from './translations.ts';
    /** Each field beside an icon that says what it is. */
    const
    const ContactDetail: ({ contact }: {
    contact?: Contact;
    }) => React.JSX.Element

    Each field beside an icon that says what it is.

    ContactDetail
    = ({
    contact: Contact | undefined
    contact
    }: {
    contact?: Contact | undefined
    contact
    ?:
    type Contact = {
    id: string;
    name: string;
    email: string;
    role: string;
    }
    Contact
    }) => {
    const {
    const t: TFunction<Namespace<string>, KeyPrefix<Namespace<string>>>
    t
    } =
    import Hooks
    Hooks
    .
    function useTranslation(ns?: string | string[] | readonly string[] | undefined, options?: UseTranslationOptions<KeyPrefix<Namespace<string>>> | undefined): {
    toString(): string;
    toLocaleString(): string;
    toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
    pop(): boolean | TFunction<Namespace<string>, KeyPrefix<Namespace<string>>> | i18n | undefined;
    push(...items: (boolean | TFunction<Namespace<string>, KeyPrefix<Namespace<string>>> | i18n)[]): number;
    concat(...items: ConcatArray<boolean | TFunction<...> | i18n>[]): (boolean | TFunction<...> | i18n)[];
    concat(...items: (boolean | ConcatArray<boolean | TFunction<...> | i18n> | TFunction<...> | i18n)[]): (boolean | TFunction<...> | i18n)[];
    join(separator?: string): string;
    reverse(): (boolean | TFunction<...> | i18n)[];
    shift(): boolean | TFunction<...> | i18n | undefined;
    slice(start?: number, end?: number): (boolean | TFunction<...> | i18n)[];
    sort(compareFn?: ((a: boolean | TFunction<...> | i18n, b: boolean | TFunction<...> | i18n) => number) | undefined): UseTranslationResponse<...>;
    splice(start: number, deleteCount?: number): (boolean | TFunction<...> | i18n)[];
    splice(start: number, deleteCount: number, ...items: (boolean | TFunction<...> | i18n)[]): (boolean | TFunction<...> | i18n)[];
    unshift(...items: (boolean | TFunction<...> | i18n)[]): number;
    indexOf(searchElement: boolean | TFunction<...> | i18n, fromIndex?: number): number;
    lastIndexOf(searchElement: boolean | TFunction<...> | i18n, fromIndex?: number): number;
    every<S extends boolean | TFunction<...> | i18n>(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => value is S, thisArg?: any): this is S[];
    every(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): boolean;
    some(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): boolean;
    forEach(callbackfn: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => void, thisArg?: any): void;
    map<U>(callbackfn: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => U, thisArg?: any): U[];
    filter<S extends boolean | TFunction<...> | i18n>(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => value is S, thisArg?: any): S[];
    filter(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): (boolean | TFunction<...> | i18n)[];
    reduce(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduce(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n, initialValue: boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduce<U>(callbackfn: (previousValue: U, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => U, initialValue: U): U;
    reduceRight(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduceRight(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n, initialValue: boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduceRight<U>(callbackfn: (previousValue: U, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => U, initialValue: U): U;
    find<S extends boolean | TFunction<...> | i18n>(predicate: (value: boolean | TFunction<...> | i18n, index: number, obj: (boolean | TFunction<...> | i18n)[]) => value is S, thisArg?: any): S | undefined;
    find(predicate: (value: boolean | TFunction<...> | i18n, index: number, obj: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): boolean | TFunction<...> | i18n | undefined;
    findIndex(predicate: (value: boolean | TFunction<...> | i18n, index: number, obj: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): number;
    fill(value: boolean | TFunction<...> | i18n, start?: number, end?: number): UseTranslationResponse<...>;
    copyWithin ...
    export useTranslation
    useTranslation
    (
    const ns: "com.example.contacts"
    ns
    );
    if (!
    contact: Contact | undefined
    contact
    ) {
    return <
    import Status
    Status
    .
    const Empty: React.ForwardRefExoticComponent<Omit<Status.EmptyProps, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    Stands in for content that is not there (no items, no selection, no result): a centred status message, its text the children or the translated "No items". Composites build their own Empty part on it.

    Empty
    icon?: string | undefined

    A Phosphor icon above the message; decorative, since the message carries the statement.

    icon
    ='ph--address-book--regular'>{
    const t: TFunction
    <"empty.message", ReactI18NextChild | Iterable<ReactI18NextChild>, StringMap>(key: "empty.message" | "empty.message"[], options?: string | TOptions<StringMap> | undefined) => ReactI18NextChild | Iterable<ReactI18NextChild> (+1 overload)
    t
    ('empty.message')}</
    import Status
    Status
    .
    const Empty: React.ForwardRefExoticComponent<Omit<Status.EmptyProps, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    Stands in for content that is not there (no items, no selection, no result): a centred status message, its text the children or the translated "No items". Composites build their own Empty part on it.

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

    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.

    column
    gap?: Layout.Gap | undefined
    gap
    ='sm'
    classNames?: ClassNameValue
    classNames
    ='p-4'>
    <
    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
    asChild?: boolean | undefined
    asChild
    >
    <
    JSX.IntrinsicElements.h2: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>
    h2
    >{
    contact: Contact
    contact
    .
    name: string
    name
    }</
    JSX.IntrinsicElements.h2: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>
    h2
    >
    </
    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 Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    gap?: Layout.Gap | undefined
    gap
    ='sm'
    align?: Layout.Align | undefined
    align
    ='center'>
    <
    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--envelope--regular' />
    <
    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
    tone?: Typography.TextTone | undefined

    Emphasis below the default (DESIGN.md "Text emphasis"): description for secondary content, subdued for interface text.

    tone
    ='muted'>{
    contact: Contact
    contact
    .
    email: string
    email
    }</
    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 Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    >
    <
    import Tooltip
    Tooltip
    .
    function Root({ openDelay, lazyMount, unmountOnExit, positioning, ...props }: Tooltip.RootProps): React.JSX.Element
    export Root
    Root
    >
    <
    import Tooltip
    Tooltip
    .
    const Trigger: React.ForwardRefExoticComponent<Omit<TooltipTriggerProps, "content"> & {
    content?: React.ReactNode;
    side?: Tooltip.Side;
    } & React.RefAttributes<HTMLButtonElement>>
    export Trigger

    Use asChild to describe a Button. Opens on hover after the Root's delay and on keyboard focus only; the delay runs here because zag skips it while any tooltip is marked open, so a click would flash one (DESIGN.md follow-up 33). With content it needs no Root or Content around it.

    Trigger
    asChild?: boolean | undefined

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

    asChild
    >
    {/* Focusable, so a keyboard user can open the tooltip too. */}
    <
    JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
    div
    HTMLAttributes<HTMLDivElement>.tabIndex?: number | undefined
    tabIndex
    ={0}>
    <
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    gap?: Layout.Gap | undefined
    gap
    ='sm'
    align?: Layout.Align | undefined
    align
    ='center'>
    <
    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--identification-badge--regular' />
    <
    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
    tone?: Typography.TextTone | undefined

    Emphasis below the default (DESIGN.md "Text emphasis"): description for secondary content, subdued for interface text.

    tone
    ='muted'>{
    contact: Contact
    contact
    .
    role: string
    role
    }</
    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 Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    >
    </
    JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
    div
    >
    </
    import Tooltip
    Tooltip
    .
    const Trigger: React.ForwardRefExoticComponent<Omit<TooltipTriggerProps, "content"> & {
    content?: React.ReactNode;
    side?: Tooltip.Side;
    } & React.RefAttributes<HTMLButtonElement>>
    export Trigger

    Use asChild to describe a Button. Opens on hover after the Root's delay and on keyboard focus only; the delay runs here because zag skips it while any tooltip is marked open, so a click would flash one (DESIGN.md follow-up 33). With content it needs no Root or Content around it.

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

    Portalled text on the inverted surface (as the current Tooltip; no data-surface, whose popup fill it would fight), capped at 20rem wide, with an arrow unless arrow={false}.

    Content
    >{
    const t: TFunction
    <`role.${string}`, ReactI18NextChild | Iterable<ReactI18NextChild>, StringMap>(key: `role.${string}` | `role.${string}`[], options?: string | TOptions<StringMap> | undefined) => ReactI18NextChild | Iterable<ReactI18NextChild> (+1 overload)
    t
    (`role.${
    contact: Contact
    contact
    .
    role: string
    role
    }`)}</
    import Tooltip
    Tooltip
    .
    const Content: React.ForwardRefExoticComponent<Omit<TooltipContentProps, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    size?: Size;
    arrow?: boolean;
    container?: React.RefObject<HTMLElement | null>;
    } & React.RefAttributes<HTMLDivElement>>
    export Content

    Portalled text on the inverted surface (as the current Tooltip; no data-surface, whose popup fill it would fight), capped at 20rem wide, with an arrow unless arrow={false}.

    Content
    >
    </
    import Tooltip
    Tooltip
    .
    function Root({ openDelay, lazyMount, unmountOnExit, positioning, ...props }: Tooltip.RootProps): React.JSX.Element
    export Root
    Root
    >
    </
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    >
    );
    };

    Each icon prop is a whole name, which is how IconsPlugin finds it. A name put together at run time would not be in the sprite.

  3. Use the strings. The toolbar reads its text from t. Add is an icon button whose label is both its tooltip and its name for screen readers. Edit and Delete take their labels as props, so we pass them in from t too.

    Add this to the same file:

    import
    (alias) namespace React
    import React
    React
    , {
    function useState<S>(initialState: S | (() => S)): [S, React.Dispatch<React.SetStateAction<S>>] (+1 overload)

    Returns a stateful value, and a function to update it.

    @version ― 16.8.0

    @see ― https://react.dev/reference/react/useState

    useState
    } from 'react';
    import * as
    import Button
    Button
    from '@dxos/react-ui/Button';
    import * as
    import Hooks
    Hooks
    from '@dxos/react-ui/Hooks';
    1 collapsed line
    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';
    1 collapsed line
    import * as
    import Status
    Status
    from '@dxos/react-ui/Status';
    import * as
    import Toolbar
    Toolbar
    from '@dxos/react-ui/Toolbar';
    3 collapsed lines
    import * as
    import Tooltip
    Tooltip
    from '@dxos/react-ui/Tooltip';
    import * as
    import Typography
    Typography
    from '@dxos/react-ui/Typography';
    import { type
    type Contact = {
    id: string;
    name: string;
    email: string;
    role: string;
    }
    Contact
    ,
    const CONTACTS: Contact[]
    CONTACTS
    } from '../contacts.ts';
    import {
    const ContactList: ({ contacts, selected, onSelect }: ContactListProps) => React.JSX.Element

    One row per contact; the list scrolls inside its own viewport.

    ContactList
    } from '../layout/ContactsScreen.tsx';
    import {
    const DeletePopover: ({ label, onDelete }: DeletePopoverProps) => React.JSX.Element
    DeletePopover
    ,
    const EditDialog: ({ label, contact, onSave }: EditDialogProps) => React.JSX.Element

    The editor from the last page, in a dialog that closes on Save.

    EditDialog
    } from '../overlays/ContactsScreen.tsx';
    import {
    const ns: "com.example.contacts"
    ns
    } from './translations.ts';
    33 collapsed lines
    /** Each field beside an icon that says what it is. */
    const
    const ContactDetail: ({ contact }: {
    contact?: Contact;
    }) => React.JSX.Element

    Each field beside an icon that says what it is.

    ContactDetail
    = ({
    contact: Contact | undefined
    contact
    }: {
    contact?: Contact | undefined
    contact
    ?:
    type Contact = {
    id: string;
    name: string;
    email: string;
    role: string;
    }
    Contact
    }) => {
    const {
    const t: TFunction<Namespace<string>, KeyPrefix<Namespace<string>>>
    t
    } =
    import Hooks
    Hooks
    .
    function useTranslation(ns?: string | string[] | readonly string[] | undefined, options?: UseTranslationOptions<KeyPrefix<Namespace<string>>> | undefined): {
    toString(): string;
    toLocaleString(): string;
    toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
    pop(): boolean | TFunction<Namespace<string>, KeyPrefix<Namespace<string>>> | i18n | undefined;
    push(...items: (boolean | TFunction<Namespace<string>, KeyPrefix<Namespace<string>>> | i18n)[]): number;
    concat(...items: ConcatArray<boolean | TFunction<...> | i18n>[]): (boolean | TFunction<...> | i18n)[];
    concat(...items: (boolean | ConcatArray<boolean | TFunction<...> | i18n> | TFunction<...> | i18n)[]): (boolean | TFunction<...> | i18n)[];
    join(separator?: string): string;
    reverse(): (boolean | TFunction<...> | i18n)[];
    shift(): boolean | TFunction<...> | i18n | undefined;
    slice(start?: number, end?: number): (boolean | TFunction<...> | i18n)[];
    sort(compareFn?: ((a: boolean | TFunction<...> | i18n, b: boolean | TFunction<...> | i18n) => number) | undefined): UseTranslationResponse<...>;
    splice(start: number, deleteCount?: number): (boolean | TFunction<...> | i18n)[];
    splice(start: number, deleteCount: number, ...items: (boolean | TFunction<...> | i18n)[]): (boolean | TFunction<...> | i18n)[];
    unshift(...items: (boolean | TFunction<...> | i18n)[]): number;
    indexOf(searchElement: boolean | TFunction<...> | i18n, fromIndex?: number): number;
    lastIndexOf(searchElement: boolean | TFunction<...> | i18n, fromIndex?: number): number;
    every<S extends boolean | TFunction<...> | i18n>(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => value is S, thisArg?: any): this is S[];
    every(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): boolean;
    some(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): boolean;
    forEach(callbackfn: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => void, thisArg?: any): void;
    map<U>(callbackfn: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => U, thisArg?: any): U[];
    filter<S extends boolean | TFunction<...> | i18n>(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => value is S, thisArg?: any): S[];
    filter(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): (boolean | TFunction<...> | i18n)[];
    reduce(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduce(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n, initialValue: boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduce<U>(callbackfn: (previousValue: U, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => U, initialValue: U): U;
    reduceRight(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduceRight(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n, initialValue: boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduceRight<U>(callbackfn: (previousValue: U, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => U, initialValue: U): U;
    find<S extends boolean | TFunction<...> | i18n>(predicate: (value: boolean | TFunction<...> | i18n, index: number, obj: (boolean | TFunction<...> | i18n)[]) => value is S, thisArg?: any): S | undefined;
    find(predicate: (value: boolean | TFunction<...> | i18n, index: number, obj: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): boolean | TFunction<...> | i18n | undefined;
    findIndex(predicate: (value: boolean | TFunction<...> | i18n, index: number, obj: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): number;
    fill(value: boolean | TFunction<...> | i18n, start?: number, end?: number): UseTranslationResponse<...>;
    copyWithin ...
    export useTranslation
    useTranslation
    (
    const ns: "com.example.contacts"
    ns
    );
    if (!
    contact: Contact | undefined
    contact
    ) {
    return <
    import Status
    Status
    .
    const Empty: React.ForwardRefExoticComponent<Omit<Status.EmptyProps, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    Stands in for content that is not there (no items, no selection, no result): a centred status message, its text the children or the translated "No items". Composites build their own Empty part on it.

    Empty
    icon?: string | undefined

    A Phosphor icon above the message; decorative, since the message carries the statement.

    icon
    ='ph--address-book--regular'>{
    const t: TFunction
    <"empty.message", ReactI18NextChild | Iterable<ReactI18NextChild>, StringMap>(key: "empty.message" | "empty.message"[], options?: string | TOptions<StringMap> | undefined) => ReactI18NextChild | Iterable<ReactI18NextChild> (+1 overload)
    t
    ('empty.message')}</
    import Status
    Status
    .
    const Empty: React.ForwardRefExoticComponent<Omit<Status.EmptyProps, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    Stands in for content that is not there (no items, no selection, no result): a centred status message, its text the children or the translated "No items". Composites build their own Empty part on it.

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

    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.

    column
    gap?: Layout.Gap | undefined
    gap
    ='sm'
    classNames?: ClassNameValue
    classNames
    ='p-4'>
    <
    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
    asChild?: boolean | undefined
    asChild
    >
    <
    JSX.IntrinsicElements.h2: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>
    h2
    >{
    contact: Contact
    contact
    .
    name: string
    name
    }</
    JSX.IntrinsicElements.h2: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>
    h2
    >
    </
    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 Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    gap?: Layout.Gap | undefined
    gap
    ='sm'
    align?: Layout.Align | undefined
    align
    ='center'>
    <
    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--envelope--regular' />
    <
    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
    tone?: Typography.TextTone | undefined

    Emphasis below the default (DESIGN.md "Text emphasis"): description for secondary content, subdued for interface text.

    tone
    ='muted'>{
    contact: Contact
    contact
    .
    email: string
    email
    }</
    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 Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    >
    <
    import Tooltip
    Tooltip
    .
    function Root({ openDelay, lazyMount, unmountOnExit, positioning, ...props }: Tooltip.RootProps): React.JSX.Element
    export Root
    Root
    >
    <
    import Tooltip
    Tooltip
    .
    const Trigger: React.ForwardRefExoticComponent<Omit<TooltipTriggerProps, "content"> & {
    content?: React.ReactNode;
    side?: Tooltip.Side;
    } & React.RefAttributes<HTMLButtonElement>>
    export Trigger

    Use asChild to describe a Button. Opens on hover after the Root's delay and on keyboard focus only; the delay runs here because zag skips it while any tooltip is marked open, so a click would flash one (DESIGN.md follow-up 33). With content it needs no Root or Content around it.

    Trigger
    asChild?: boolean | undefined

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

    asChild
    >
    {/* Focusable, so a keyboard user can open the tooltip too. */}
    <
    JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
    div
    HTMLAttributes<HTMLDivElement>.tabIndex?: number | undefined
    tabIndex
    ={0}>
    <
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    gap?: Layout.Gap | undefined
    gap
    ='sm'
    align?: Layout.Align | undefined
    align
    ='center'>
    <
    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--identification-badge--regular' />
    <
    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
    tone?: Typography.TextTone | undefined

    Emphasis below the default (DESIGN.md "Text emphasis"): description for secondary content, subdued for interface text.

    tone
    ='muted'>{
    contact: Contact
    contact
    .
    role: string
    role
    }</
    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 Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    >
    </
    JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
    div
    >
    </
    import Tooltip
    Tooltip
    .
    const Trigger: React.ForwardRefExoticComponent<Omit<TooltipTriggerProps, "content"> & {
    content?: React.ReactNode;
    side?: Tooltip.Side;
    } & React.RefAttributes<HTMLButtonElement>>
    export Trigger

    Use asChild to describe a Button. Opens on hover after the Root's delay and on keyboard focus only; the delay runs here because zag skips it while any tooltip is marked open, so a click would flash one (DESIGN.md follow-up 33). With content it needs no Root or Content around it.

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

    Portalled text on the inverted surface (as the current Tooltip; no data-surface, whose popup fill it would fight), capped at 20rem wide, with an arrow unless arrow={false}.

    Content
    >{
    const t: TFunction
    <`role.${string}`, ReactI18NextChild | Iterable<ReactI18NextChild>, StringMap>(key: `role.${string}` | `role.${string}`[], options?: string | TOptions<StringMap> | undefined) => ReactI18NextChild | Iterable<ReactI18NextChild> (+1 overload)
    t
    (`role.${
    contact: Contact
    contact
    .
    role: string
    role
    }`)}</
    import Tooltip
    Tooltip
    .
    const Content: React.ForwardRefExoticComponent<Omit<TooltipContentProps, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    size?: Size;
    arrow?: boolean;
    container?: React.RefObject<HTMLElement | null>;
    } & React.RefAttributes<HTMLDivElement>>
    export Content

    Portalled text on the inverted surface (as the current Tooltip; no data-surface, whose popup fill it would fight), capped at 20rem wide, with an arrow unless arrow={false}.

    Content
    >
    </
    import Tooltip
    Tooltip
    .
    function Root({ openDelay, lazyMount, unmountOnExit, positioning, ...props }: Tooltip.RootProps): React.JSX.Element
    export Root
    Root
    >
    </
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    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
    >
    );
    };
    export const
    const ContactsScreen: () => React.JSX.Element
    ContactsScreen
    = () => {
    const {
    const t: TFunction<Namespace<string>, KeyPrefix<Namespace<string>>>
    t
    } =
    import Hooks
    Hooks
    .
    function useTranslation(ns?: string | string[] | readonly string[] | undefined, options?: UseTranslationOptions<KeyPrefix<Namespace<string>>> | undefined): {
    toString(): string;
    toLocaleString(): string;
    toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
    pop(): boolean | TFunction<Namespace<string>, KeyPrefix<Namespace<string>>> | i18n | undefined;
    push(...items: (boolean | TFunction<Namespace<string>, KeyPrefix<Namespace<string>>> | i18n)[]): number;
    concat(...items: ConcatArray<boolean | TFunction<...> | i18n>[]): (boolean | TFunction<...> | i18n)[];
    concat(...items: (boolean | ConcatArray<boolean | TFunction<...> | i18n> | TFunction<...> | i18n)[]): (boolean | TFunction<...> | i18n)[];
    join(separator?: string): string;
    reverse(): (boolean | TFunction<...> | i18n)[];
    shift(): boolean | TFunction<...> | i18n | undefined;
    slice(start?: number, end?: number): (boolean | TFunction<...> | i18n)[];
    sort(compareFn?: ((a: boolean | TFunction<...> | i18n, b: boolean | TFunction<...> | i18n) => number) | undefined): UseTranslationResponse<...>;
    splice(start: number, deleteCount?: number): (boolean | TFunction<...> | i18n)[];
    splice(start: number, deleteCount: number, ...items: (boolean | TFunction<...> | i18n)[]): (boolean | TFunction<...> | i18n)[];
    unshift(...items: (boolean | TFunction<...> | i18n)[]): number;
    indexOf(searchElement: boolean | TFunction<...> | i18n, fromIndex?: number): number;
    lastIndexOf(searchElement: boolean | TFunction<...> | i18n, fromIndex?: number): number;
    every<S extends boolean | TFunction<...> | i18n>(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => value is S, thisArg?: any): this is S[];
    every(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): boolean;
    some(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): boolean;
    forEach(callbackfn: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => void, thisArg?: any): void;
    map<U>(callbackfn: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => U, thisArg?: any): U[];
    filter<S extends boolean | TFunction<...> | i18n>(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => value is S, thisArg?: any): S[];
    filter(predicate: (value: boolean | TFunction<...> | i18n, index: number, array: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): (boolean | TFunction<...> | i18n)[];
    reduce(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduce(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n, initialValue: boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduce<U>(callbackfn: (previousValue: U, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => U, initialValue: U): U;
    reduceRight(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduceRight(callbackfn: (previousValue: boolean | TFunction<...> | i18n, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => boolean | TFunction<...> | i18n, initialValue: boolean | TFunction<...> | i18n): boolean | TFunction<...> | i18n;
    reduceRight<U>(callbackfn: (previousValue: U, currentValue: boolean | TFunction<...> | i18n, currentIndex: number, array: (boolean | TFunction<...> | i18n)[]) => U, initialValue: U): U;
    find<S extends boolean | TFunction<...> | i18n>(predicate: (value: boolean | TFunction<...> | i18n, index: number, obj: (boolean | TFunction<...> | i18n)[]) => value is S, thisArg?: any): S | undefined;
    find(predicate: (value: boolean | TFunction<...> | i18n, index: number, obj: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): boolean | TFunction<...> | i18n | undefined;
    findIndex(predicate: (value: boolean | TFunction<...> | i18n, index: number, obj: (boolean | TFunction<...> | i18n)[]) => unknown, thisArg?: any): number;
    fill(value: boolean | TFunction<...> | i18n, start?: number, end?: number): UseTranslationResponse<...>;
    copyWithin ...
    export useTranslation
    useTranslation
    (
    const ns: "com.example.contacts"
    ns
    );
    const [
    const contacts: Contact[]
    contacts
    ,
    const setContacts: React.Dispatch<React.SetStateAction<Contact[]>>
    setContacts
    ] =
    useState<Contact[]>(initialState: Contact[] | (() => Contact[])): [Contact[], React.Dispatch<React.SetStateAction<Contact[]>>] (+1 overload)

    Returns a stateful value, and a function to update it.

    @version ― 16.8.0

    @see ― https://react.dev/reference/react/useState

    useState
    (
    const CONTACTS: Contact[]
    CONTACTS
    );
    const [
    const selected: string | undefined
    selected
    ,
    const setSelected: React.Dispatch<React.SetStateAction<string | undefined>>
    setSelected
    ] =
    useState<string | undefined>(initialState: string | (() => string | undefined) | undefined): [string | undefined, React.Dispatch<React.SetStateAction<string | undefined>>] (+1 overload)

    Returns a stateful value, and a function to update it.

    @version ― 16.8.0

    @see ― https://react.dev/reference/react/useState

    useState
    <string | undefined>(
    const contacts: Contact[]
    contacts
    [0].
    id: string
    id
    );
    const
    const contact: Contact | undefined
    contact
    =
    const contacts: Contact[]
    contacts
    .
    Array<Contact>.find(predicate: (value: Contact, index: number, obj: Contact[]) => unknown, thisArg?: any): Contact | undefined (+1 overload)

    Returns the value of the first element in the array where predicate is true, and undefined otherwise.

    @param ― predicate find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.

    @param ― thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

    find
    (({
    id: string
    id
    }) =>
    id: string
    id
    ===
    const selected: string | undefined
    selected
    );
    const
    const handleAdd: () => void
    handleAdd
    = () => {
    const
    const contact: Contact
    contact
    :
    type Contact = {
    id: string;
    name: string;
    email: string;
    role: string;
    }
    Contact
    = {
    id: string
    id
    :
    var crypto: Crypto
    crypto
    .
    Crypto.randomUUID(): `${string}-${string}-${string}-${string}-${string}`

    The randomUUID() method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator. Available only in secure contexts.

    MDN Reference

    randomUUID
    (),
    name: string
    name
    :
    const t: TFunction
    <"new-contact.name", string, StringMap>(key: "new-contact.name" | "new-contact.name"[], options?: string | TOptions<StringMap> | undefined) => string (+1 overload)
    t
    ('new-contact.name'),
    email: string
    email
    : '',
    role: string
    role
    : 'viewer',
    };
    const setContacts: (value: React.SetStateAction<Contact[]>) => void
    setContacts
    ((
    contacts: Contact[]
    contacts
    ) => [...
    contacts: Contact[]
    contacts
    ,
    const contact: Contact
    contact
    ]);
    const setSelected: (value: React.SetStateAction<string | undefined>) => void
    setSelected
    (
    const contact: Contact
    contact
    .
    id: string
    id
    );
    };
    const
    const handleSave: (next: Contact) => void
    handleSave
    = (
    next: Contact
    next
    :
    type Contact = {
    id: string;
    name: string;
    email: string;
    role: string;
    }
    Contact
    ) =>
    const setContacts: (value: React.SetStateAction<Contact[]>) => void
    setContacts
    ((
    contacts: Contact[]
    contacts
    ) =>
    contacts: Contact[]
    contacts
    .
    Array<Contact>.map<Contact>(callbackfn: (value: Contact, index: number, array: Contact[]) => Contact, thisArg?: any): Contact[]

    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
    ((
    contact: Contact
    contact
    ) => (
    contact: Contact
    contact
    .
    id: string
    id
    ===
    next: Contact
    next
    .
    id: string
    id
    ?
    next: Contact
    next
    :
    contact: Contact
    contact
    )));
    const
    const handleDelete: (id: string) => void
    handleDelete
    = (
    id: string
    id
    : string) => {
    const setContacts: (value: React.SetStateAction<Contact[]>) => void
    setContacts
    ((
    contacts: Contact[]
    contacts
    ) =>
    contacts: Contact[]
    contacts
    .
    Array<Contact>.filter(predicate: (value: Contact, index: number, array: Contact[]) => unknown, thisArg?: any): Contact[] (+1 overload)

    Returns the elements of an array that meet the condition specified in a callback function.

    @param ― predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

    @param ― thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

    filter
    ((
    contact: Contact
    contact
    ) =>
    contact: Contact
    contact
    .
    id: string
    id
    !==
    id: string
    id
    ));
    const setSelected: (value: React.SetStateAction<string | undefined>) => void
    setSelected
    (
    var undefined
    undefined
    );
    };
    return (
    <
    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
    >{
    const t: TFunction
    <"title.label", ReactI18NextChild | Iterable<ReactI18NextChild>, StringMap>(key: "title.label" | "title.label"[], options?: string | TOptions<StringMap> | undefined) => ReactI18NextChild | Iterable<ReactI18NextChild> (+1 overload)
    t
    ('title.label')}</
    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 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 t: TFunction
    <"count.label", ReactI18NextChild | Iterable<ReactI18NextChild>, {
    count: number;
    }>(key: "count.label" | "count.label"[], options?: string | TOptions<{
    count: number;
    }> | undefined) => ReactI18NextChild | Iterable<ReactI18NextChild> (+1 overload)
    t
    ('count.label', {
    count: number

    Count value used for plurals

    count
    :
    const contacts: Contact[]
    contacts
    .
    Array<T>.length: number

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

    length
    })}</
    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?: "line" | "gap" | 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
    ={
    const t: TFunction
    <"add.label", string | undefined, StringMap>(key: "add.label" | "add.label"[], options?: string | TOptions<StringMap> | undefined) => string | undefined (+1 overload)
    t
    ('add.label')}
    iconOnly?: boolean | undefined

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

    iconOnly
    onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined
    onClick
    ={
    const handleAdd: () => void
    handleAdd
    } />
    {
    const contact: Contact | undefined
    contact
    && <
    const EditDialog: ({ label, contact, onSave }: EditDialogProps) => React.JSX.Element

    The editor from the last page, in a dialog that closes on Save.

    EditDialog
    label: string
    label
    ={
    const t: TFunction
    <"edit.label", string, StringMap>(key: "edit.label" | "edit.label"[], options?: string | TOptions<StringMap> | undefined) => string (+1 overload)
    t
    ('edit.label')}
    contact: Contact
    contact
    ={
    const contact: Contact
    contact
    }
    onSave: (contact: Contact) => void
    onSave
    ={
    const handleSave: (next: Contact) => void
    handleSave
    } />}
    {
    const contact: Contact | undefined
    contact
    && <
    const DeletePopover: ({ label, onDelete }: DeletePopoverProps) => React.JSX.Element
    DeletePopover
    label: string
    label
    ={
    const t: TFunction
    <"delete.label", string, StringMap>(key: "delete.label" | "delete.label"[], options?: string | TOptions<StringMap> | undefined) => string (+1 overload)
    t
    ('delete.label')}
    onDelete: () => void
    onDelete
    ={() =>
    const handleDelete: (id: string) => void
    handleDelete
    (
    const contact: Contact
    contact
    .
    id: string
    id
    )} />}
    </
    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 Layout
    Layout
    .
    const Grid: React.ForwardRefExoticComponent<Omit<Layout.GridProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

    CSS grid container.

    cols/rows take a count for equal tracks, or a list of tokens for anything asymmetric: cols={['fill', 'min']} is grid-cols-[1fr_min-content], with the flexible track allowed to shrink so long content truncates rather than widening the grid. The tokens are typed, so a misspelt track is a compile error rather than an invalid template.

    subgrid adopts the parent's tracks and spans them (grid-column: 1 / -1), which is the only way it is ever useful; the parent must actually define those tracks. Check Column.Row and Card.Row first — both already are 3-track subgrid rows.

    gap is restricted to the named steps of the theme spacing ramp (see

    Gap

    ). As with Flex, padding, sizing, and colour go through classNames rather than growing props here.

    @example

    <Grid cols={3} gap='sm'>…</Grid>
    <Grid cols={['fill', 'auto']} gap='md' align='center'>…</Grid>
    <Grid cols={['18rem', 'fill']}>…</Grid>
    <Grid cols='subgrid' gap='sm' align='center'>…</Grid>

    Grid
    cols?: Layout.GridTracks | undefined
    cols
    ={['16rem', 'fill']}
    grow?: boolean | undefined

    Fill and clip the parent (dx-expand); off by default, as Flex's is, so a grid sizes to its content.

    grow
    >
    <
    const ContactList: ({ contacts, selected, onSelect }: ContactListProps) => React.JSX.Element

    One row per contact; the list scrolls inside its own viewport.

    ContactList
    contacts: Contact[]
    contacts
    ={
    const contacts: Contact[]
    contacts
    }
    selected?: string | undefined
    selected
    ={
    const selected: string | undefined
    selected
    }
    onSelect: (id: string) => void
    onSelect
    ={
    const setSelected: React.Dispatch<React.SetStateAction<string | undefined>>
    setSelected
    } />
    <
    const ContactDetail: ({ contact }: {
    contact?: Contact;
    }) => React.JSX.Element

    Each field beside an icon that says what it is.

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

    CSS grid container.

    cols/rows take a count for equal tracks, or a list of tokens for anything asymmetric: cols={['fill', 'min']} is grid-cols-[1fr_min-content], with the flexible track allowed to shrink so long content truncates rather than widening the grid. The tokens are typed, so a misspelt track is a compile error rather than an invalid template.

    subgrid adopts the parent's tracks and spans them (grid-column: 1 / -1), which is the only way it is ever useful; the parent must actually define those tracks. Check Column.Row and Card.Row first — both already are 3-track subgrid rows.

    gap is restricted to the named steps of the theme spacing ramp (see

    Gap

    ). As with Flex, padding, sizing, and colour go through classNames rather than growing props here.

    @example

    <Grid cols={3} gap='sm'>…</Grid>
    <Grid cols={['fill', 'auto']} gap='md' align='center'>…</Grid>
    <Grid cols={['18rem', 'fill']}>…</Grid>
    <Grid cols='subgrid' gap='sm' align='center'>…</Grid>

    Grid
    >
    </
    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 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
    >
    );
    };

    handleDelete clears the selection, and ContactDetail then shows its hint. EditDialog and DeletePopover come from the last page as they are, so the strings inside them are not in the resource yet. This screen also leaves out the toast.

  4. Register the resource and render the screen. Theme.Provider takes our resource beside react-ui’s own. In src/main.tsx, import react-ui’s translations under the name uiTranslations, import ours and this page’s ContactsScreen, and replace the render:

    import {
    function createRoot(container: Container, options?: RootOptions): Root

    createRoot lets you create a root to display React components inside a browser DOM node.

    @see ― https://react.dev/reference/react-dom/client/createRoot API Reference for createRoot

    createRoot
    } from 'react-dom/client';
    2 collapsed lines
    import '@dxos/react-ui/theme.css';
    import * as
    import Theme
    Theme
    from '@dxos/react-ui/Theme';
    2 collapsed lines
    import {
    const translations: [{
    readonly 'en-US': {
    readonly "@dxos/react-ui": {
    readonly "empty.label": "No items";
    readonly "error-fallback.title.label": "Runtime Error";
    readonly "error-fallback.stack.label": "Stack";
    readonly "error-fallback.data.label": "Data";
    readonly "steps.step.label": "Step {{index}}";
    readonly "remove.label": "Delete";
    readonly "toolbar-menu.label": "Action menu";
    readonly "toolbar-drag-handle.label": "Drag to rearrange";
    readonly "toolbar-close.label": "Close";
    readonly "toolbar-delete.label": "Delete";
    readonly "floating-panel.minimize.label": "Minimize";
    readonly "floating-panel.maximize.label": "Maximize";
    readonly "floating-panel.restore.label": "Restore";
    readonly "drawer.resize.label": "Resize drawer";
    readonly "system-button.star.label": "Star";
    readonly "system-button.unstar.label": "Unstar";
    readonly "system-button.bookmark.label": "Bookmark";
    readonly "system-button.unbookmark.label": "Remove bookmark";
    readonly "system-button.check.label": "Check";
    readonly "system-button.uncheck.label": "Uncheck";
    readonly "system-button.expand.label": "Expand";
    readonly "system-button.collapse.label": "Collapse";
    readonly "system-button.ai.label": "Run AI";
    readonly "system-button.add.label": "Add";
    readonly "system-button.delete.label": "Delete";
    readonly "system-button.remove.label": "Delete";
    readonly "system-button.edit.label": "Edit";
    readonly "system-button.close.label": "Close";
    readonly "system-button.open.label": "Open";
    readonly "system-button.save.label": "Save";
    readonly "system-button.cancel.label": "Cancel";
    readonly "system-button.upload.label": "Upload";
    readonly "system-button.download.label": "Download";
    readonly "system-button.clipboard.label": "Copy";
    readonly "system-button.copied.label": "Copied";
    readonly "carousel-viewport.label": "Carousel";
    readonly "carousel-prev.label": "Previous slide";
    readonly "carousel-next.label": "Next slide";
    readonly "carousel-indicators.label": "Carousel slides";
    readonly "carousel-go-to.label": "Go to slide {{index}}";
    readonly "date-picker.placeholder.single.label": "Pick a date";
    readonly "date-picker.placeholder.range.label": "Pick a date range";
    readonly "date-picker.placeholder.multiple.label": "Pick dates";
    readonly "date-picker.clear.label": "Clear";
    readonly "calendar.nav.previous.label": "Previous month";
    readonly "calendar.nav.next.label": "Next month";
    readonly "calendar.nav.previous-year.label": "Previous year";
    readonly "calendar.nav.next-year.label": "Next year";
    readonly "calendar.nav.previous-decade.label": "Previous decade";
    readonly "calendar.nav.next-decade.label": "Next decade";
    readonly "calendar.footer.today.label": "Today";
    readonly "trigger-button.label": "Open";
    readonly "number-input.increment.label": "Increment";
    readonly "number-input.decrement.label": "Decrement";
    readonly "number-input.slider.label": "Adjust";
    readonly "password-input.show.label": "Show password";
    readonly "password-input.hide.label": "Hide password";
    readonly "tag.delete.label": "Remove {{label}}";
    readonly "combobox.search.label": "Search";
    readonly "combobox.empty.label": "No results";
    readonly "combobox.loading.label": "Loading\u2026";
    readonly "combobox.create.label": "Create \u201C{{query}}\u201D";
    readonly "drag-handle.label": "Drag to rearrange";
    readonly "drag-handle.role.label": "drag handle";
    readonly "drag-handle.grabbed.message": "Grabbed. Press the arrow keys to move, Space to drop.";
    readonly "drag-handle.moved-up.message": "Moved up.";
    readonly "drag-handle.moved-down.message": "Moved down.";
    readonly "drag-handle.dropped.message": "Dropped.";
    };
    };
    }]
    translations
    as
    const uiTranslations: [{
    readonly 'en-US': {
    readonly "@dxos/react-ui": {
    readonly "empty.label": "No items";
    readonly "error-fallback.title.label": "Runtime Error";
    readonly "error-fallback.stack.label": "Stack";
    readonly "error-fallback.data.label": "Data";
    readonly "steps.step.label": "Step {{index}}";
    readonly "remove.label": "Delete";
    readonly "toolbar-menu.label": "Action menu";
    readonly "toolbar-drag-handle.label": "Drag to rearrange";
    readonly "toolbar-close.label": "Close";
    readonly "toolbar-delete.label": "Delete";
    readonly "floating-panel.minimize.label": "Minimize";
    readonly "floating-panel.maximize.label": "Maximize";
    readonly "floating-panel.restore.label": "Restore";
    readonly "drawer.resize.label": "Resize drawer";
    readonly "system-button.star.label": "Star";
    readonly "system-button.unstar.label": "Unstar";
    readonly "system-button.bookmark.label": "Bookmark";
    readonly "system-button.unbookmark.label": "Remove bookmark";
    readonly "system-button.check.label": "Check";
    readonly "system-button.uncheck.label": "Uncheck";
    readonly "system-button.expand.label": "Expand";
    readonly "system-button.collapse.label": "Collapse";
    readonly "system-button.ai.label": "Run AI";
    readonly "system-button.add.label": "Add";
    readonly "system-button.delete.label": "Delete";
    readonly "system-button.remove.label": "Delete";
    readonly "system-button.edit.label": "Edit";
    readonly "system-button.close.label": "Close";
    readonly "system-button.open.label": "Open";
    readonly "system-button.save.label": "Save";
    readonly "system-button.cancel.label": "Cancel";
    readonly "system-button.upload.label": "Upload";
    readonly "system-button.download.label": "Download";
    readonly "system-button.clipboard.label": "Copy";
    readonly "system-button.copied.label": "Copied";
    readonly "carousel-viewport.label": "Carousel";
    readonly "carousel-prev.label": "Previous slide";
    readonly "carousel-next.label": "Next slide";
    readonly "carousel-indicators.label": "Carousel slides";
    readonly "carousel-go-to.label": "Go to slide {{index}}";
    readonly "date-picker.placeholder.single.label": "Pick a date";
    readonly "date-picker.placeholder.range.label": "Pick a date range";
    readonly "date-picker.placeholder.multiple.label": "Pick dates";
    readonly "date-picker.clear.label": "Clear";
    readonly "calendar.nav.previous.label": "Previous month";
    readonly "calendar.nav.next.label": "Next month";
    readonly "calendar.nav.previous-year.label": "Previous year";
    readonly "calendar.nav.next-year.label": "Next year";
    readonly "calendar.nav.previous-decade.label": "Previous decade";
    readonly "calendar.nav.next-decade.label": "Next decade";
    readonly "calendar.footer.today.label": "Today";
    readonly "trigger-button.label": "Open";
    readonly "number-input.increment.label": "Increment";
    readonly "number-input.decrement.label": "Decrement";
    readonly "number-input.slider.label": "Adjust";
    readonly "password-input.show.label": "Show password";
    readonly "password-input.hide.label": "Hide password";
    readonly "tag.delete.label": "Remove {{label}}";
    readonly "combobox.search.label": "Search";
    readonly "combobox.empty.label": "No results";
    readonly "combobox.loading.label": "Loading\u2026";
    readonly "combobox.create.label": "Create \u201C{{query}}\u201D";
    readonly "drag-handle.label": "Drag to rearrange";
    readonly "drag-handle.role.label": "drag handle";
    readonly "drag-handle.grabbed.message": "Grabbed. Press the arrow keys to move, Space to drop.";
    readonly "drag-handle.moved-up.message": "Moved up.";
    readonly "drag-handle.moved-down.message": "Moved down.";
    readonly "drag-handle.dropped.message": "Dropped.";
    };
    };
    }]
    uiTranslations
    } from '@dxos/react-ui/translations';
    import {
    const ContactsScreen: () => React.JSX.Element
    ContactsScreen
    } from './icons/ContactsScreen.tsx';
    2 collapsed lines
    import {
    const translations: [{
    readonly 'en-US': {
    readonly "com.example.contacts": {
    readonly 'title.label': "Contacts";
    readonly 'count.label_one': "{{count}} contact";
    readonly 'count.label_other': "{{count}} contacts";
    readonly 'add.label': "Add contact";
    readonly 'edit.label': "Edit contact";
    readonly 'delete.label': "Delete contact";
    readonly 'empty.message': "Choose a contact";
    readonly 'new-contact.name': "New contact";
    readonly 'role.viewer': "Can read the contact book";
    readonly 'role.editor': "Can change contacts";
    readonly 'role.admin': "Can change contacts and who has access";
    };
    };
    }]
    translations
    } from './icons/translations.ts';
    function createRoot(container: Container, options?: RootOptions): Root

    createRoot lets you create a root to display React components inside a browser DOM node.

    @see ― https://react.dev/reference/react-dom/client/createRoot API Reference for createRoot

    createRoot
    (
    var document: Document

    window.document returns a reference to the document contained in the window.

    MDN Reference

    document
    .
    Document.getElementById(elementId: string): HTMLElement | null

    The getElementById() method of the Document interface returns an Element object representing the element whose id property matches the specified string. Since element IDs are required to be unique if specified, they're a useful way to get access to a specific element quickly.

    getElementById
    ('root')!).
    Root.render(children: React.ReactNode): void
    render
    (
    <
    import Theme
    Theme
    .
    const Provider: ({ children, fallback, resourceExtensions, appNs, tx, themeMode, platform, }: Theme.ProviderProps) => React.JSX.Element
    export Provider
    Provider
    tx?: ThemeFunction<Record<string, any>> | undefined
    tx
    ={
    import Theme
    Theme
    .
    const defaultTx: ThemeFunction<Record<string, any>>
    defaultTx
    }
    resourceExtensions?: Theme.Resource[] | undefined
    resourceExtensions
    ={[...
    const uiTranslations: [{
    readonly 'en-US': {
    readonly "@dxos/react-ui": {
    readonly "empty.label": "No items";
    readonly "error-fallback.title.label": "Runtime Error";
    readonly "error-fallback.stack.label": "Stack";
    readonly "error-fallback.data.label": "Data";
    readonly "steps.step.label": "Step {{index}}";
    readonly "remove.label": "Delete";
    readonly "toolbar-menu.label": "Action menu";
    readonly "toolbar-drag-handle.label": "Drag to rearrange";
    readonly "toolbar-close.label": "Close";
    readonly "toolbar-delete.label": "Delete";
    readonly "floating-panel.minimize.label": "Minimize";
    readonly "floating-panel.maximize.label": "Maximize";
    readonly "floating-panel.restore.label": "Restore";
    readonly "drawer.resize.label": "Resize drawer";
    readonly "system-button.star.label": "Star";
    readonly "system-button.unstar.label": "Unstar";
    readonly "system-button.bookmark.label": "Bookmark";
    readonly "system-button.unbookmark.label": "Remove bookmark";
    readonly "system-button.check.label": "Check";
    readonly "system-button.uncheck.label": "Uncheck";
    readonly "system-button.expand.label": "Expand";
    readonly "system-button.collapse.label": "Collapse";
    readonly "system-button.ai.label": "Run AI";
    readonly "system-button.add.label": "Add";
    readonly "system-button.delete.label": "Delete";
    readonly "system-button.remove.label": "Delete";
    readonly "system-button.edit.label": "Edit";
    readonly "system-button.close.label": "Close";
    readonly "system-button.open.label": "Open";
    readonly "system-button.save.label": "Save";
    readonly "system-button.cancel.label": "Cancel";
    readonly "system-button.upload.label": "Upload";
    readonly "system-button.download.label": "Download";
    readonly "system-button.clipboard.label": "Copy";
    readonly "system-button.copied.label": "Copied";
    readonly "carousel-viewport.label": "Carousel";
    readonly "carousel-prev.label": "Previous slide";
    readonly "carousel-next.label": "Next slide";
    readonly "carousel-indicators.label": "Carousel slides";
    readonly "carousel-go-to.label": "Go to slide {{index}}";
    readonly "date-picker.placeholder.single.label": "Pick a date";
    readonly "date-picker.placeholder.range.label": "Pick a date range";
    readonly "date-picker.placeholder.multiple.label": "Pick dates";
    readonly "date-picker.clear.label": "Clear";
    readonly "calendar.nav.previous.label": "Previous month";
    readonly "calendar.nav.next.label": "Next month";
    readonly "calendar.nav.previous-year.label": "Previous year";
    readonly "calendar.nav.next-year.label": "Next year";
    readonly "calendar.nav.previous-decade.label": "Previous decade";
    readonly "calendar.nav.next-decade.label": "Next decade";
    readonly "calendar.footer.today.label": "Today";
    readonly "trigger-button.label": "Open";
    readonly "number-input.increment.label": "Increment";
    readonly "number-input.decrement.label": "Decrement";
    readonly "number-input.slider.label": "Adjust";
    readonly "password-input.show.label": "Show password";
    readonly "password-input.hide.label": "Hide password";
    readonly "tag.delete.label": "Remove {{label}}";
    readonly "combobox.search.label": "Search";
    readonly "combobox.empty.label": "No results";
    readonly "combobox.loading.label": "Loading\u2026";
    readonly "combobox.create.label": "Create \u201C{{query}}\u201D";
    readonly "drag-handle.label": "Drag to rearrange";
    readonly "drag-handle.role.label": "drag handle";
    readonly "drag-handle.grabbed.message": "Grabbed. Press the arrow keys to move, Space to drop.";
    readonly "drag-handle.moved-up.message": "Moved up.";
    readonly "drag-handle.moved-down.message": "Moved down.";
    readonly "drag-handle.dropped.message": "Dropped.";
    };
    };
    }]
    uiTranslations
    , ...
    const translations: [{
    readonly 'en-US': {
    readonly "com.example.contacts": {
    readonly 'title.label': "Contacts";
    readonly 'count.label_one': "{{count}} contact";
    readonly 'count.label_other': "{{count}} contacts";
    readonly 'add.label': "Add contact";
    readonly 'edit.label': "Edit contact";
    readonly 'delete.label': "Delete contact";
    readonly 'empty.message': "Choose a contact";
    readonly 'new-contact.name': "New contact";
    readonly 'role.viewer': "Can read the contact book";
    readonly 'role.editor': "Can change contacts";
    readonly 'role.admin': "Can change contacts and who has access";
    };
    };
    }]
    translations
    ]}>
    <
    const ContactsScreen: () => React.JSX.Element
    ContactsScreen
    />
    </
    import Theme
    Theme
    .
    const Provider: ({ children, fallback, resourceExtensions, appNs, tx, themeMode, platform, }: Theme.ProviderProps) => React.JSX.Element
    export Provider
    Provider
    >,
    );

    A resource that is missing from resourceExtensions shows on screen as its keys, such as add.label.

Delete contacts until one is left and watch the count. Press Add, then Edit to name the new contact.

You can use icons by name and keep a screen’s strings in a resource. Next, Connect to ECHO stores the contacts in a database that syncs.