Skip to content
Docs
AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTo5M2QyOTM5My0zYzhjLTQyMjgtOTM3Ni1hNzdmN2IzZGY4MDgAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaFsEYebDG3FvGzPqRPUGj+wAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDowMGEyZTMzZi04NDBlLTQ0ZTgtOGE0My1hYzk2YWU1N2Q4MmJscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNoNmsqqw2iJhjiFoZVB8T++wAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1zZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmluZ3JlZGllbnQudjNkaGFzaFgg7eLapPRp/WAhypMvu3U4qOESlG8WlEG4DAvacsi4/K6kZmFjdGlvbngdY29tLmFudGhyb3BpYy5jbGF1ZGUucHJvdmlkZWRqcGFyYW1ldGVyc6F4H2NvbS5hbnRocm9waWMub3JpZ2luLWNvbmZpZGVuY2VndW5rbm93bmtkZXNjcmlwdGlvbnhmQ2xhdWRlIHByb3ZpZGVkIHRoaXMgZmlsZSBhdCB0aGUgcmVxdWVzdCBvZiBhIHVzZXIgYW5kIG1heSBoYXZlIGNyZWF0ZWQgb3IgbW9kaWZpZWQgdGhlIGZpbGUgY29udGVudHMubXNvZnR3YXJlQWdlbnShZG5hbWVmQ2xhdWRlcmFsbEFjdGlvbnNJbmNsdWRlZPUAAADIanVtYgAAAEBqdW1kY2JvcgARABCAAACqADibcRNjMnBhLmhhc2guZGF0YQAAAAAYYzJzaHt2UeED92BshgyCiQwYY88AAACAY2JvcqVjYWxnZnNoYTI1NmNwYWRMAAAAAAAAAAAAAAAAZGhhc2hYIItAuixXT/8Lw8+EC0pyDaSGRki/S2vn0ieSVLllPsbgZG5hbWVuanVtYmYgbWFuaWZlc3RqZXhjbHVzaW9uc4GiZXN0YXJ0GQRNZmxlbmd0aBkeBAAAAj5qdW1iAAAAJ2p1bWRjMmNsABEAEIAAAKoAOJtxA2MycGEuY2xhaW0udjIAAAACD2Nib3KlY2FsZ2ZzaGEyNTZpc2lnbmF0dXJleE1zZWxmI2p1bWJmPS9jMnBhL3VybjpjMnBhOjkzZDI5MzkzLTNjOGMtNDIyOC05Mzc2LWE3N2Y3YjNkZjgwOC9jMnBhLnNpZ25hdHVyZWppbnN0YW5jZUlEeCx4bXA6aWlkOjU2M2EwMDllLWVjN2MtNDMzNi04NDYyLTE3YmM4MzdiMzE1MHJjcmVhdGVkX2Fzc2VydGlvbnODomN1cmx4LXNlbGYjanVtYmY9YzJwYS5hc3NlcnRpb25zL2MycGEuaW5ncmVkaWVudC52M2RoYXNoWCDt4tqk9Gn9YCHKky+7dTio4RKUbxaUQbgMC9pyyLj8rqJjdXJseCpzZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmFjdGlvbnMudjJkaGFzaFgg4HJkJVo60GHdpUAYtCHpmuidhhIcRcySk54DT+CvcDCiY3VybHgpc2VsZiNqdW1iZj1jMnBhLmFzc2VydGlvbnMvYzJwYS5oYXNoLmRhdGFkaGFzaFggcc364gkqMh7kdn2aiMyB7hvuMsIljd7u1jB/wDuW3j10Y2xhaW1fZ2VuZXJhdG9yX2luZm+jZG5hbWVvQW50aHJvcGljIEZpbGVzZ3ZlcnNpb25lMS4wLjBrc3BlY1ZlcnNpb25lMi40LjAAABA4anVtYgAAAChqdW1kYzJjcwARABCAAACqADibcQNjMnBhLnNpZ25hdHVyZQAAABAIY2JvctKEWQISogEmGCFZAgowggIGMIIBjaADAgECAhRA5aAK7sI50L64g/oGQgU9Z1UTADAKBggqhkjOPQQDAzBJMRcwFQYDVQQKEw5BbnRocm9waWMsIFBCQzEuMCwGA1UEAxMlQW50aHJvcGljIENvbnRlbnQgQ3JlZGVudGlhbHMgUm9vdCBDQTAeFw0yNjA4MDcxODQzNTZaFw0yODA4MDYxOTQzNTZaMEQxFzAVBgNVBAoTDkFudGhyb3BpYywgUEJDMSkwJwYDVQQDEyBBbnRocm9waWMgQ2xhdWRlIENvbnRlbnQgU2lnbmluZzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJh6CmvLUBgFFNU0vUKlOVtE6djd17L5SuwX0LemFisBM3dkd/3cyjxFA3Qo5S46fX0/ihY0VZ7mfb9KF703t5OjWDBWMA4GA1UdDwEB/wQEAwIHgDAVBgNVHSUEDjAMBgorBgEEAYPoXgIBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUzlHiBIFOZFsj+OPEz5o+nMHXXMIwCgYIKoZIzj0EAwMDZwAwZAIwMXMdFJ4BetLLVY7ORuE9noqbbAZOZn/aArXyTwFAZfKrPzxF2vPoJNf1+UCdg1XGAjBwX1zd9WGqYkqmL5SFqw1QySjr1zJfpJM9+1rdDwSPLMOPOjKuiXjoU/pUUeG9RwmhY3BhZFkNngAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQAumujy5kXaOKurr6zgTP2krHrFVXi2kj8seRYrlvq2GssUjReh5MiVpQbLFQNy9HsmcasqpBNVsXytWTw0ZDjA=

Connect to ECHO

By the end of this page the contacts are objects in ECHO, DXOS’s database. They are stored on the device, and they sync to your other devices and to anyone you share the space with. The edit dialog is a form built from their schema.

So far the contacts live in React state, which a reload resets and no other device sees. To move them into ECHO, we change three things from the last page:

  • An ECHO type replaces the Contact type. ECHO checks and syncs objects of a type it knows. Step 2 adds the type.
  • useQuery replaces the useState that held the list. It returns the objects that match, and the component renders again when one is added or removed, here or on another device. Step 7 makes the swap.
  • useObject reads one object. A component that reads an object’s fields this way renders again when that object changes. Steps 4 and 5 use it.

We take the type from ECHO’s own learning path. Its Person has a name, an email and an employer, and no role. The role select, the role’s tooltip and the role.* strings from the earlier pages therefore have no place on this screen.

  1. Install the React client and the form package. @dxos/react-client holds the hooks, and @dxos/react-ui-form holds the form. Until the next npm release, they come from the same build as the packages in Installation:

    Terminal window
    npm install \
    https://pkg.pr.new/dxos/dxos/@dxos/react-client@20a14b9 \
    https://pkg.pr.new/dxos/dxos/@dxos/react-ui-form@20a14b9
    npm install --save-dev vite-plugin-wasm

    Then add the bundler settings from step 2 of ECHO’s Installation to vite.config.ts, so the database’s worker and WebAssembly load. Those settings use vite-plugin-wasm.

  2. Use ECHO’s Person type. This is the Person from ECHO’s Defining types, with a name, an optional email and an optional employer. Add src/echo/schema.ts. Put that page’s Organization type in it first, because employer refers to it:

    import * as
    import Schema
    Schema
    from 'effect/Schema';
    import {
    import Annotation
    Annotation
    ,
    import DXN
    DXN
    ,
    import Format
    Format
    ,
    import Ref
    Ref
    ,
    import Type
    Type
    } from '@dxos/echo';
    15 collapsed lines
    // The ECHO tutorial's types, unchanged; see /docs/echo/learn/defining-types/.
    export class
    class Organization
    Organization
    extends
    import Type
    Type
    .
    const makeObject: <Organization>(dxn: DXN.DXN, options?: {
    id?: EntityId;
    }) => Type.MakeObject<Organization>

    Factory function to create an ECHO object type.

    Returns a Type.Type entity — a live, in-memory TypeSchema instance, NOT a Schema.Schema. Use Type.InstanceType<typeof Foo> for the instance type and Type.getSchema(Foo) to obtain the underlying Effect Schema.

    The entity's id defaults to EntityId.deterministic(typename, version) so constructing a type never reaches crypto.getRandomValues() — required for Cloudflare workerd, which forbids RNG calls in global (module-evaluation) scope. Pass { id } to override (e.g. with EntityId.random() from a request handler).

    Giving the type a nominal class name keeps its inferred type portable for declaration emit: structural expansion (which can pull in unnameable union members from referenced schemas) is replaced by a reference to the class.

    The second call takes either a schema, or struct fields (wrapped in Schema.Struct) with an optional function that pipes annotations onto the struct.

    @example

    export class Person extends Type.makeObject<Person>(DXN.make('com.example.type.myType', '0.1.0'))(Schema.Struct({
    name: Schema.String,
    })) {}
    export class Tag extends Type.makeObject<Tag>(DXN.make('com.example.type.tag', '0.1.0'))(
    { label: Schema.String },
    Annotation.LabelAnnotation.set(['label']),
    ) {}

    @performance ― O(schema size) once at definition time; builds the type entity eagerly, so call it at module scope, not per use.

    makeObject
    <
    class Organization
    Organization
    >(
    import DXN
    DXN
    .
    const make: <"com.example.type.organization">(nsid: "com.example.type.organization", version?: string) => DXN.DXN

    Constructs a DXN from an NSID (and optional version). Throws if the result is not a valid DXN. Use tryMake for non-throwing string parsing.

    Static NSID strings are validated at compile time via

    Name

    : the final segment must be camelCase (no hyphens). Template-literal strings with a runtime prefix are accepted here but still validated at runtime.

    @example make('org.dxos.type.calendar') → 'dxn:org.dxos.type.calendar'

    @example make('org.dxos.type.calendar', '1.0.0') → 'dxn:org.dxos.type.calendar:1.0.0'

    make
    ('com.example.type.organization', '0.1.0'))(
    import Schema
    Schema
    .
    function Struct<{
    readonly name: Schema.String;
    readonly website: Schema.optional<Schema.String>;
    }>(fields: {
    readonly name: Schema.String;
    readonly website: Schema.optional<Schema.String>;
    }): Schema.Struct<{
    readonly name: Schema.String;
    readonly website: Schema.optional<Schema.String>;
    }>

    Defines a struct schema from a map of field schemas.

    Details

    Each field value is a schema. Use

    optionalKey

    or

    optional

    to mark fields as optional, and

    mutableKey

    to mark them as mutable. Field definitions are discovered from own enumerable string and symbol properties of fields. Non-enumerable and inherited definitions are ignored.

    The resulting schema's Type is a readonly object type with the fields' decoded types. The Encoded form mirrors the field schemas' encoded types. Declared fields on the input may be non-enumerable or inherited and are copied to own properties in the output. The __proto__ field is accepted only when it is an own property. Parsing does not guarantee that output keys retain their input order.

    Example (Defining a basic struct)

    import { Schema } from "effect"
    const Person = Schema.Struct({
    name: Schema.String,
    age: Schema.Number,
    email: Schema.optionalKey(Schema.String)
    })
    // { readonly name: string; readonly age: number; readonly email?: string }
    type Person = typeof Person.Type
    Schema.decodeUnknownSync(Person)({ name: "Alice", age: 30 }) // => { name: "Alice", age: 30 }

    @stability ― stable

    @category ― constructors

    @since ― 3.10.0

    Struct
    ({
    name: Schema.String
    name
    :
    import Schema
    Schema
    .
    const String: Schema.String

    Type-level representation of

    String

    .

    Schema for string values. Validates that the input is typeof "string".

    @stability ― stable

    @category ― models

    @since ― 4.0.0

    @stability ― stable

    @category ― schemas

    @since ― 4.0.0

    String
    ,
    website: Schema.optional<Schema.String>
    website
    :
    import Schema
    Schema
    .
    const optional: optionalLambda
    <Schema.String>(self: Schema.String) => Schema.optional<Schema.String>

    Type-level representation returned by

    optional

    .

    Marks a struct field as optional, allowing the key to be absent or undefined.

    Details

    The resulting property may be absent or explicitly set to undefined. Equivalent to optionalKey(UndefinedOr(S)).

    Use

    optionalKey

    instead if you want exact optional semantics (absent only, not undefined).

    Example (Defining an optional field accepting undefined)

    import { Schema } from "effect"
    const schema = Schema.Struct({
    name: Schema.String,
    age: Schema.optional(Schema.Number)
    })
    // { readonly name: string; readonly age?: number | undefined }
    type Person = typeof schema.Type

    @stability ― stable

    @category ― models

    @since ― 3.10.0

    @stability ― stable

    @category ― combinators

    @since ― 3.10.0

    optional
    (
    import Format
    Format
    .URL),
    }).
    Pipeable.pipe<Schema.Struct<{
    readonly name: Schema.String;
    readonly website: Schema.optional<Schema.String>;
    }>, Schema.Struct<{
    readonly name: Schema.String;
    readonly website: Schema.optional<Schema.String>;
    }>>(this: Schema.Struct<...>, ab: (_: Schema.Struct<{
    readonly name: Schema.String;
    readonly website: Schema.optional<Schema.String>;
    }>) => Schema.Struct<{
    readonly name: Schema.String;
    readonly website: Schema.optional<Schema.String>;
    }>): Schema.Struct<...> (+21 overloads)
    pipe
    (
    import Annotation
    Annotation
    .
    const IconAnnotation: Annotation.Annotation<Annotation.IconAnnotation>
    export IconAnnotation

    Icon to render in the UI.

    IconAnnotation
    .
    Annotation<IconAnnotation>.set: (value: Annotation.IconAnnotation) => <S extends Schema.Top>(schema: S) => S

    Set the annotation on an Effect schema.

    Only accepts Schema.Top — annotations must be applied to the source schema BEFORE wrapping it with Type.makeObject / Type.makeRelation. In a pipe, place every Annotation.X.set(...) before the Type.make... step.

    @performance ― O(value size) encode, once at schema-definition time.

    set
    ({
    icon: string

    Sprite icon name (e.g., 'ph--user--regular', 'ph--cube--regular', 'px--anthropic--regular').

    ph--* is Phosphor; px--* and dx--* are brand glyphs, which are sprite-only and carry no weight variants. All three are admitted because a type whose subject IS a brand — an Anthropic session, a GitHub repo — has no honest Phosphor equivalent.

    icon
    : 'ph--buildings--regular',
    hue?: string | undefined

    Color name.

    List of colors:

    • 'red'
    • 'orange'
    • 'amber'
    • 'yellow'
    • 'lime'
    • 'green'
    • 'emerald'
    • 'teal'
    • 'cyan'
    • 'violet'
    • 'purple'
    • 'fuchsia'
    • 'pink'
    • 'rose'

    hue
    : 'amber',
    }),
    ),
    ) {}
    export class
    class Person
    Person
    extends
    import Type
    Type
    .
    const makeObject: <Person>(dxn: DXN.DXN, options?: {
    id?: EntityId;
    }) => Type.MakeObject<Person>

    Factory function to create an ECHO object type.

    Returns a Type.Type entity — a live, in-memory TypeSchema instance, NOT a Schema.Schema. Use Type.InstanceType<typeof Foo> for the instance type and Type.getSchema(Foo) to obtain the underlying Effect Schema.

    The entity's id defaults to EntityId.deterministic(typename, version) so constructing a type never reaches crypto.getRandomValues() — required for Cloudflare workerd, which forbids RNG calls in global (module-evaluation) scope. Pass { id } to override (e.g. with EntityId.random() from a request handler).

    Giving the type a nominal class name keeps its inferred type portable for declaration emit: structural expansion (which can pull in unnameable union members from referenced schemas) is replaced by a reference to the class.

    The second call takes either a schema, or struct fields (wrapped in Schema.Struct) with an optional function that pipes annotations onto the struct.

    @example

    export class Person extends Type.makeObject<Person>(DXN.make('com.example.type.myType', '0.1.0'))(Schema.Struct({
    name: Schema.String,
    })) {}
    export class Tag extends Type.makeObject<Tag>(DXN.make('com.example.type.tag', '0.1.0'))(
    { label: Schema.String },
    Annotation.LabelAnnotation.set(['label']),
    ) {}

    @performance ― O(schema size) once at definition time; builds the type entity eagerly, so call it at module scope, not per use.

    makeObject
    <
    class Person
    Person
    >(
    import DXN
    DXN
    .
    const make: <"com.example.type.person">(nsid: "com.example.type.person", version?: string) => DXN.DXN

    Constructs a DXN from an NSID (and optional version). Throws if the result is not a valid DXN. Use tryMake for non-throwing string parsing.

    Static NSID strings are validated at compile time via

    Name

    : the final segment must be camelCase (no hyphens). Template-literal strings with a runtime prefix are accepted here but still validated at runtime.

    @example make('org.dxos.type.calendar') → 'dxn:org.dxos.type.calendar'

    @example make('org.dxos.type.calendar', '1.0.0') → 'dxn:org.dxos.type.calendar:1.0.0'

    make
    ('com.example.type.person', '0.1.0'))(
    import Schema
    Schema
    .
    function Struct<{
    readonly name: Schema.String;
    readonly email: Schema.optional<Schema.String>;
    readonly employer: Schema.optional<Ref.RefSchema<Organization & OfKind<EntityKind.Object> & Unknown>>;
    }>(fields: {
    readonly name: Schema.String;
    readonly email: Schema.optional<Schema.String>;
    readonly employer: Schema.optional<Ref.RefSchema<Organization & OfKind<EntityKind.Object> & Unknown>>;
    }): Schema.Struct<...>

    Defines a struct schema from a map of field schemas.

    Details

    Each field value is a schema. Use

    optionalKey

    or

    optional

    to mark fields as optional, and

    mutableKey

    to mark them as mutable. Field definitions are discovered from own enumerable string and symbol properties of fields. Non-enumerable and inherited definitions are ignored.

    The resulting schema's Type is a readonly object type with the fields' decoded types. The Encoded form mirrors the field schemas' encoded types. Declared fields on the input may be non-enumerable or inherited and are copied to own properties in the output. The __proto__ field is accepted only when it is an own property. Parsing does not guarantee that output keys retain their input order.

    Example (Defining a basic struct)

    import { Schema } from "effect"
    const Person = Schema.Struct({
    name: Schema.String,
    age: Schema.Number,
    email: Schema.optionalKey(Schema.String)
    })
    // { readonly name: string; readonly age: number; readonly email?: string }
    type Person = typeof Person.Type
    Schema.decodeUnknownSync(Person)({ name: "Alice", age: 30 }) // => { name: "Alice", age: 30 }

    @stability ― stable

    @category ― constructors

    @since ― 3.10.0

    Struct
    ({
    name: Schema.String
    name
    :
    import Schema
    Schema
    .
    const String: Schema.String

    Type-level representation of

    String

    .

    Schema for string values. Validates that the input is typeof "string".

    @stability ― stable

    @category ― models

    @since ― 4.0.0

    @stability ― stable

    @category ― schemas

    @since ― 4.0.0

    String
    ,
    email: Schema.optional<Schema.String>
    email
    :
    import Schema
    Schema
    .
    const optional: optionalLambda
    <Schema.String>(self: Schema.String) => Schema.optional<Schema.String>

    Type-level representation returned by

    optional

    .

    Marks a struct field as optional, allowing the key to be absent or undefined.

    Details

    The resulting property may be absent or explicitly set to undefined. Equivalent to optionalKey(UndefinedOr(S)).

    Use

    optionalKey

    instead if you want exact optional semantics (absent only, not undefined).

    Example (Defining an optional field accepting undefined)

    import { Schema } from "effect"
    const schema = Schema.Struct({
    name: Schema.String,
    age: Schema.optional(Schema.Number)
    })
    // { readonly name: string; readonly age?: number | undefined }
    type Person = typeof schema.Type

    @stability ― stable

    @category ― models

    @since ― 3.10.0

    @stability ― stable

    @category ― combinators

    @since ― 3.10.0

    optional
    (
    import Format
    Format
    .
    const Email: Schema.String

    Email address (RFC 5321). The local part also allows an apostrophe, which real mail carries (o'day@corp.com). https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.2

    Email
    ),
    employer: Schema.optional<Ref.RefSchema<Organization & OfKind<EntityKind.Object> & Unknown>>
    employer
    :
    import Schema
    Schema
    .
    const optional: optionalLambda
    <Ref.RefSchema<Organization & OfKind<EntityKind.Object> & Unknown>>(self: Ref.RefSchema<Organization & OfKind<EntityKind.Object> & Unknown>) => Schema.optional<Ref.RefSchema<Organization & OfKind<EntityKind.Object> & Unknown>>

    Type-level representation returned by

    optional

    .

    Marks a struct field as optional, allowing the key to be absent or undefined.

    Details

    The resulting property may be absent or explicitly set to undefined. Equivalent to optionalKey(UndefinedOr(S)).

    Use

    optionalKey

    instead if you want exact optional semantics (absent only, not undefined).

    Example (Defining an optional field accepting undefined)

    import { Schema } from "effect"
    const schema = Schema.Struct({
    name: Schema.String,
    age: Schema.optional(Schema.Number)
    })
    // { readonly name: string; readonly age?: number | undefined }
    type Person = typeof schema.Type

    @stability ― stable

    @category ― models

    @since ― 3.10.0

    @stability ― stable

    @category ― combinators

    @since ― 3.10.0

    optional
    (
    import Ref
    Ref
    .
    const Ref: <typeof Organization>(type: typeof Organization) => Ref.RefSchema<Organization & OfKind<EntityKind.Object> & Unknown> (+3 overloads)
    Ref
    (
    class Organization
    Organization
    )),
    }).
    Pipeable.pipe<Schema.Struct<{
    readonly name: Schema.String;
    readonly email: Schema.optional<Schema.String>;
    readonly employer: Schema.optional<Ref.RefSchema<Organization & OfKind<EntityKind.Object> & Unknown>>;
    }>, Schema.Struct<{
    readonly name: Schema.String;
    readonly email: Schema.optional<Schema.String>;
    readonly employer: Schema.optional<Ref.RefSchema<Organization & OfKind<EntityKind.Object> & Unknown>>;
    }>>(this: Schema.Struct<...>, ab: (_: Schema.Struct<...>) => Schema.Struct<...>): Schema.Struct<...> (+21 overloads)
    pipe
    (
    import Annotation
    Annotation
    .
    const IconAnnotation: Annotation.Annotation<Annotation.IconAnnotation>
    export IconAnnotation

    Icon to render in the UI.

    IconAnnotation
    .
    Annotation<IconAnnotation>.set: (value: Annotation.IconAnnotation) => <S extends Schema.Top>(schema: S) => S

    Set the annotation on an Effect schema.

    Only accepts Schema.Top — annotations must be applied to the source schema BEFORE wrapping it with Type.makeObject / Type.makeRelation. In a pipe, place every Annotation.X.set(...) before the Type.make... step.

    @performance ― O(value size) encode, once at schema-definition time.

    set
    ({
    icon: string

    Sprite icon name (e.g., 'ph--user--regular', 'ph--cube--regular', 'px--anthropic--regular').

    ph--* is Phosphor; px--* and dx--* are brand glyphs, which are sprite-only and carry no weight variants. All three are admitted because a type whose subject IS a brand — an Anthropic session, a GitHub repo — has no honest Phosphor equivalent.

    icon
    : 'ph--user--regular',
    hue?: string | undefined

    Color name.

    List of colors:

    • 'red'
    • 'orange'
    • 'amber'
    • 'yellow'
    • 'lime'
    • 'green'
    • 'emerald'
    • 'teal'
    • 'cyan'
    • 'violet'
    • 'purple'
    • 'fuchsia'
    • 'pink'
    • 'rose'

    hue
    : 'cyan' })),
    ) {}
  3. Query the people. The query selects every Person, sorted by name. Add src/echo/ContactsScreen.tsx:

    import { type
    import Database
    Database
    ,
    import Filter
    Filter
    ,
    import Obj
    Obj
    ,
    import Order
    Order
    ,
    import Query
    Query
    } from '@dxos/echo';
    15 collapsed lines
    import {
    const useObject: {
    <T extends Obj.Unknown>(ref: Ref<T>): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined, options: LoadOptions): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T): [Obj.Snapshot<T>, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(objOrRef: T | Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T, property: K): [T[K], ObjectPropUpdateCallback<T[K]>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T>, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T> | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    }
    useObject
    ,
    const useQuery: UseQueryFn

    Create subscription.

    @param ― queryOrFilter - The query or filter to apply. Query is memoized based on the AST. No need to call useMemo.

    useQuery
    } from '@dxos/react-client/echo';
    import {
    const ObjectForm: ({ object, type, schema, showTags }: ObjectFormProps) => React.JSX.Element

    An object's properties (and meta tags) as a next Form in its host's grid, writing each change back.

    ObjectForm
    } from '@dxos/react-ui-form';
    import * as
    import Button
    Button
    from '@dxos/react-ui/Button';
    import * as
    import Dialog
    Dialog
    from '@dxos/react-ui/Dialog';
    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';
    import * as
    import Listbox
    Listbox
    from '@dxos/react-ui/Listbox';
    import * as
    import Panel
    Panel
    from '@dxos/react-ui/Panel';
    import * as
    import Status
    Status
    from '@dxos/react-ui/Status';
    import * as
    import Toolbar
    Toolbar
    from '@dxos/react-ui/Toolbar';
    import * as
    import Typography
    Typography
    from '@dxos/react-ui/Typography';
    import {
    const ns: "com.example.contacts"
    ns
    } from '../icons/translations.ts';
    import {
    const DeletePopover: ({ label, onDelete }: DeletePopoverProps) => React.JSX.Element
    DeletePopover
    } from '../overlays/ContactsScreen.tsx';
    import {
    class Person
    Person
    } from './schema.ts';
    const
    const people: Query.Query<Person & OfKind<EntityKind.Object>>
    people
    =
    import Query
    Query
    .
    const select: <Filter.Filter<Person & OfKind<EntityKind.Object>>>(filter: Filter.Filter<Person & OfKind<EntityKind.Object>>) => Query.Query<Person & OfKind<EntityKind.Object>>

    Select objects based on a filter.

    @param ― filter - Filter to select the objects.

    @returns ― Query for the selected objects.

    @performance ― O(1); wraps the current AST in a new immutable node without executing anything.

    select
    (
    import Filter
    Filter
    .
    const type: <typeof Person>(type: typeof Person, props?: Filter.Props<Person & OfKind<EntityKind.Object>> | undefined) => Filter.Filter<Person & OfKind<EntityKind.Object>> (+4 overloads)
    type
    (
    class Person
    Person
    )).
    Query<Person & OfKind<EntityKind.Object>>.orderBy(order_0: Order.Order<Person & OfKind<EntityKind.Object>>, ...order: Order.Order<Person & OfKind<EntityKind.Object>>[]): Query.Query<Person & OfKind<EntityKind.Object>>

    Order the query results. Orders are specified in priority order. The first order will be applied first, etc.

    Order.property orders by the current result shape's fields, so it works both before and after an

    aggregate

    : before, by member (row) properties; after, by the flat record's fields (any group or aggregate field — e.g. Order.property('lastMessageAt') reorders the groups by that aggregate).

    @param ― order - Order to sort the results.

    @returns ― Query for the ordered results.

    @performance ― O(k) in the number of orders; builds the AST without executing anything.

    orderBy
    (
    import Order
    Order
    .
    const property: <Person>(property: "~@dxos/echo/Kind" | "email" | "employer" | "name" | "id", direction: OrderDirection) => Order.Order<Person>

    Order by a property of the current result shape.

    @performance ― O(1); builds an order AST node without sorting anything.

    property
    <
    class Person
    Person
    >('name', 'asc'));

    people only describes the query. Nothing reads the database until step 7 passes it to useQuery.

  4. List them. The list is the same Listbox as before. Each row reads its person with useObject, so a rename shows in the list at once:

    import {
    const useObject: {
    <T extends Obj.Unknown>(ref: Ref<T>): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined, options: LoadOptions): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T): [Obj.Snapshot<T>, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(objOrRef: T | Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T, property: K): [T[K], ObjectPropUpdateCallback<T[K]>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T>, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T> | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    }
    useObject
    ,
    const useQuery: UseQueryFn

    Create subscription.

    @param ― queryOrFilter - The query or filter to apply. Query is memoized based on the AST. No need to call useMemo.

    useQuery
    } from '@dxos/react-client/echo';
    6 collapsed lines
    import {
    const ObjectForm: ({ object, type, schema, showTags }: ObjectFormProps) => React.JSX.Element

    An object's properties (and meta tags) as a next Form in its host's grid, writing each change back.

    ObjectForm
    } from '@dxos/react-ui-form';
    import * as
    import Button
    Button
    from '@dxos/react-ui/Button';
    import * as
    import Dialog
    Dialog
    from '@dxos/react-ui/Dialog';
    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';
    import * as
    import Listbox
    Listbox
    from '@dxos/react-ui/Listbox';
    7 collapsed lines
    import * as
    import Panel
    Panel
    from '@dxos/react-ui/Panel';
    import * as
    import Status
    Status
    from '@dxos/react-ui/Status';
    import * as
    import Toolbar
    Toolbar
    from '@dxos/react-ui/Toolbar';
    import * as
    import Typography
    Typography
    from '@dxos/react-ui/Typography';
    import {
    const ns: "com.example.contacts"
    ns
    } from '../icons/translations.ts';
    import {
    const DeletePopover: ({ label, onDelete }: DeletePopoverProps) => React.JSX.Element
    DeletePopover
    } from '../overlays/ContactsScreen.tsx';
    import {
    class Person
    Person
    } from './schema.ts';
    3 collapsed lines
    const
    const people: Query.Query<Person & OfKind<EntityKind.Object>>
    people
    =
    import Query
    Query
    .
    const select: <Filter.Filter<Person & OfKind<EntityKind.Object>>>(filter: Filter.Filter<Person & OfKind<EntityKind.Object>>) => Query.Query<Person & OfKind<EntityKind.Object>>

    Select objects based on a filter.

    @param ― filter - Filter to select the objects.

    @returns ― Query for the selected objects.

    @performance ― O(1); wraps the current AST in a new immutable node without executing anything.

    select
    (
    import Filter
    Filter
    .
    const type: <typeof Person>(type: typeof Person, props?: Filter.Props<Person & OfKind<EntityKind.Object>> | undefined) => Filter.Filter<Person & OfKind<EntityKind.Object>> (+4 overloads)
    type
    (
    class Person
    Person
    )).
    Query<Person & OfKind<EntityKind.Object>>.orderBy(order_0: Order.Order<Person & OfKind<EntityKind.Object>>, ...order: Order.Order<Person & OfKind<EntityKind.Object>>[]): Query.Query<Person & OfKind<EntityKind.Object>>

    Order the query results. Orders are specified in priority order. The first order will be applied first, etc.

    Order.property orders by the current result shape's fields, so it works both before and after an

    aggregate

    : before, by member (row) properties; after, by the flat record's fields (any group or aggregate field — e.g. Order.property('lastMessageAt') reorders the groups by that aggregate).

    @param ― order - Order to sort the results.

    @returns ― Query for the ordered results.

    @performance ― O(k) in the number of orders; builds the AST without executing anything.

    orderBy
    (
    import Order
    Order
    .
    const property: <Person>(property: "~@dxos/echo/Kind" | "email" | "employer" | "name" | "id", direction: OrderDirection) => Order.Order<Person>

    Order by a property of the current result shape.

    @performance ― O(1); builds an order AST node without sorting anything.

    property
    <
    class Person
    Person
    >('name', 'asc'));
    /** A row that re-renders when its person is renamed. */
    const
    const PersonRow: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    A row that re-renders when its person is renamed.

    PersonRow
    = ({
    person: Person
    person
    }: {
    person: Person
    person
    :
    class Person
    Person
    }) => {
    const [
    const snapshot: Obj.Snapshot<Person>
    snapshot
    ] =
    useObject<Person>(obj: Person): [Obj.Snapshot<Person>, ObjectUpdateCallback<Person>] (+9 overloads)

    Hook to subscribe to an entire Echo object. Returns a snapshot of the current object value and automatically re-renders when the object changes.

    @param ― obj - The Echo object to subscribe to (objects only, not relations)

    @returns ― The current object snapshot and update callback

    useObject
    (
    person: Person
    person
    );
    return <
    import Listbox
    Listbox
    .
    const Item: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    item: Listbox.Option;
    current?: boolean;
    highlightOnHover?: boolean;
    children?: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Item

    A row (option) at least one block tall: without children, the option's icon, label and description; with them, the caller's parts, which the theme places by part (leading cells, text over description, then trailing cells) or, under Root columns, in order across the shared tracks. Pointer presses on a row control stay with the control: they neither select the row nor take focus from the control.

    Item
    item: Listbox.Option
    item
    ={{
    value: string
    value
    :
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    ,
    label: string
    label
    :
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    name: string
    name
    ,
    description?: string | undefined

    Second line of the default row.

    description
    :
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    email?: string | undefined
    email
    }} />;
    };
    type
    type PeopleListProps = {
    people: Person[];
    selected?: string;
    onSelect: (id: string) => void;
    }
    PeopleListProps
    = {
    people: Person[]
    people
    :
    class Person
    Person
    [];
    selected?: string | undefined
    selected
    ?: string;
    onSelect: (id: string) => void
    onSelect
    : (
    id: string
    id
    : string) => void;
    };
    const
    const PeopleList: ({ people, selected, onSelect }: PeopleListProps) => React.JSX.Element
    PeopleList
    = ({
    people: Person[]
    people
    ,
    selected: string | undefined
    selected
    ,
    onSelect: (id: string) => void
    onSelect
    }:
    type PeopleListProps = {
    people: Person[];
    selected?: string;
    onSelect: (id: string) => void;
    }
    PeopleListProps
    ) => (
    <
    import Listbox
    Listbox
    .
    const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onSelect">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    items: readonly Listbox.Option[];
    selectionMode?: Listbox.SelectionMode;
    value?: string[];
    defaultValue?: string[];
    onValueChange?: (value: string[]) => void;
    highlightedValue?: string | null;
    onHighlightChange?: (value: string | null) => void;
    ... 8 more ...;
    size?: Size;
    } & React.RefAttributes<...>>
    export Root

    Ark listbox: single, multiple or no selection, with keyboard navigation, typeahead and aria-selected from zag. A flex column that caps itself at its parent's height, so a long list scrolls in its Content.

    Root
    items: readonly Listbox.Option[]
    items
    ={
    people: Person[]
    people
    .
    Array<Person>.map<{
    value: string;
    label: string;
    }>(callbackfn: (value: Person, index: number, array: Person[]) => {
    value: string;
    label: string;
    }, thisArg?: any): {
    value: string;
    label: string;
    }[]

    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
    ((
    person: Person
    person
    ) => ({
    value: string
    value
    :
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    ,
    label: string
    label
    :
    person: Person
    person
    .
    name: string
    name
    }))}
    value?: string[] | undefined
    value
    ={
    selected: string | undefined
    selected
    ? [
    selected: string
    selected
    ] : []}
    onValueChange?: ((value: string[]) => void) | undefined
    onValueChange
    ={([
    id: string
    id
    ]) =>
    id: string
    id
    &&
    onSelect: (id: string) => void
    onSelect
    (
    id: string
    id
    )}
    >
    <
    import Listbox
    Listbox
    .
    const Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    children: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Viewport

    A thin overlay ScrollArea (decision 5) that grows to fill the Root, for a list that owns its scrolling (a picker, a fixed-height panel). Its Content is the scrolling element, so the thumb sits in the Content's end gutter. Omit it inside a host that already scrolls, which would otherwise trap wheel and trackpad gestures in a nested scroller.

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

    The listbox element: zag's content props with the grid keyboard in front of them, a Container's attributes so a Viewport's slot merges onto it, and the Root's virtual windowing over its direct children (the rows). Under a Viewport it is the scrolling element (inset gutter by default); otherwise its host scrolls and the rows inherit the host's rails (inherit). A windowed (virtual) list measures its scroller, so it needs a Viewport.

    Content
    "aria-label"?: string | undefined

    Defines a string value that labels the current element.

    @see ― aria-labelledby.

    aria-label
    ='Contacts'>
    {
    people: Person[]
    people
    .
    Array<Person>.map<React.JSX.Element>(callbackfn: (value: Person, index: number, array: Person[]) => React.JSX.Element, thisArg?: any): React.JSX.Element[]

    Calls a defined callback function on each element of an array, and returns an array that contains the results.

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

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

    map
    ((
    person: Person
    person
    ) => (
    <
    const PersonRow: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    A row that re-renders when its person is renamed.

    PersonRow
    Attributes.key?: React.Key | null | undefined
    key
    ={
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    }
    person: Person
    person
    ={
    person: Person
    person
    } />
    ))}
    </
    import Listbox
    Listbox
    .
    const Content: React.ForwardRefExoticComponent<Omit<Layout.ContainerProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLDivElement>>
    export Content

    The listbox element: zag's content props with the grid keyboard in front of them, a Container's attributes so a Viewport's slot merges onto it, and the Root's virtual windowing over its direct children (the rows). Under a Viewport it is the scrolling element (inset gutter by default); otherwise its host scrolls and the rows inherit the host's rails (inherit). A windowed (virtual) list measures its scroller, so it needs a Viewport.

    Content
    >
    </
    import Listbox
    Listbox
    .
    const Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    children: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Viewport

    A thin overlay ScrollArea (decision 5) that grows to fill the Root, for a list that owns its scrolling (a picker, a fixed-height panel). Its Content is the scrolling element, so the thumb sits in the Content's end gutter. Omit it inside a host that already scrolls, which would otherwise trap wheel and trackpad gestures in a nested scroller.

    Viewport
    >
    </
    import Listbox
    Listbox
    .
    const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onSelect">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    items: readonly Listbox.Option[];
    selectionMode?: Listbox.SelectionMode;
    value?: string[];
    defaultValue?: string[];
    onValueChange?: (value: string[]) => void;
    highlightedValue?: string | null;
    onHighlightChange?: (value: string | null) => void;
    ... 8 more ...;
    size?: Size;
    } & React.RefAttributes<...>>
    export Root

    Ark listbox: single, multiple or no selection, with keyboard navigation, typeahead and aria-selected from zag. A flex column that caps itself at its parent's height, so a long list scrolls in its Content.

    Root
    >
    );

    useObject returns a pair. snapshot is the first of the two, a copy of the person’s fields as they are now. The second is a function that changes the person.

  5. Show the selected person. The detail reads the person the same way. It shows the name and the email, and no role, because Person has none:

    import {
    const useObject: {
    <T extends Obj.Unknown>(ref: Ref<T>): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined, options: LoadOptions): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T): [Obj.Snapshot<T>, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(objOrRef: T | Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T, property: K): [T[K], ObjectPropUpdateCallback<T[K]>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T>, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T> | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    }
    useObject
    ,
    const useQuery: UseQueryFn

    Create subscription.

    @param ― queryOrFilter - The query or filter to apply. Query is memoized based on the AST. No need to call useMemo.

    useQuery
    } from '@dxos/react-client/echo';
    4 collapsed lines
    import {
    const ObjectForm: ({ object, type, schema, showTags }: ObjectFormProps) => React.JSX.Element

    An object's properties (and meta tags) as a next Form in its host's grid, writing each change back.

    ObjectForm
    } from '@dxos/react-ui-form';
    import * as
    import Button
    Button
    from '@dxos/react-ui/Button';
    import * as
    import Dialog
    Dialog
    from '@dxos/react-ui/Dialog';
    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';
    4 collapsed lines
    import * as
    import Listbox
    Listbox
    from '@dxos/react-ui/Listbox';
    import * as
    import Panel
    Panel
    from '@dxos/react-ui/Panel';
    import * as
    import Status
    Status
    from '@dxos/react-ui/Status';
    import * as
    import Toolbar
    Toolbar
    from '@dxos/react-ui/Toolbar';
    import * as
    import Typography
    Typography
    from '@dxos/react-ui/Typography';
    3 collapsed lines
    import {
    const ns: "com.example.contacts"
    ns
    } from '../icons/translations.ts';
    import {
    const DeletePopover: ({ label, onDelete }: DeletePopoverProps) => React.JSX.Element
    DeletePopover
    } from '../overlays/ContactsScreen.tsx';
    import {
    class Person
    Person
    } from './schema.ts';
    31 collapsed lines
    const
    const people: Query.Query<Person & OfKind<EntityKind.Object>>
    people
    =
    import Query
    Query
    .
    const select: <Filter.Filter<Person & OfKind<EntityKind.Object>>>(filter: Filter.Filter<Person & OfKind<EntityKind.Object>>) => Query.Query<Person & OfKind<EntityKind.Object>>

    Select objects based on a filter.

    @param ― filter - Filter to select the objects.

    @returns ― Query for the selected objects.

    @performance ― O(1); wraps the current AST in a new immutable node without executing anything.

    select
    (
    import Filter
    Filter
    .
    const type: <typeof Person>(type: typeof Person, props?: Filter.Props<Person & OfKind<EntityKind.Object>> | undefined) => Filter.Filter<Person & OfKind<EntityKind.Object>> (+4 overloads)
    type
    (
    class Person
    Person
    )).
    Query<Person & OfKind<EntityKind.Object>>.orderBy(order_0: Order.Order<Person & OfKind<EntityKind.Object>>, ...order: Order.Order<Person & OfKind<EntityKind.Object>>[]): Query.Query<Person & OfKind<EntityKind.Object>>

    Order the query results. Orders are specified in priority order. The first order will be applied first, etc.

    Order.property orders by the current result shape's fields, so it works both before and after an

    aggregate

    : before, by member (row) properties; after, by the flat record's fields (any group or aggregate field — e.g. Order.property('lastMessageAt') reorders the groups by that aggregate).

    @param ― order - Order to sort the results.

    @returns ― Query for the ordered results.

    @performance ― O(k) in the number of orders; builds the AST without executing anything.

    orderBy
    (
    import Order
    Order
    .
    const property: <Person>(property: "~@dxos/echo/Kind" | "email" | "employer" | "name" | "id", direction: OrderDirection) => Order.Order<Person>

    Order by a property of the current result shape.

    @performance ― O(1); builds an order AST node without sorting anything.

    property
    <
    class Person
    Person
    >('name', 'asc'));
    /** A row that re-renders when its person is renamed. */
    const
    const PersonRow: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    A row that re-renders when its person is renamed.

    PersonRow
    = ({
    person: Person
    person
    }: {
    person: Person
    person
    :
    class Person
    Person
    }) => {
    const [
    const snapshot: Obj.Snapshot<Person>
    snapshot
    ] =
    useObject<Person>(obj: Person): [Obj.Snapshot<Person>, ObjectUpdateCallback<Person>] (+9 overloads)

    Hook to subscribe to an entire Echo object. Returns a snapshot of the current object value and automatically re-renders when the object changes.

    @param ― obj - The Echo object to subscribe to (objects only, not relations)

    @returns ― The current object snapshot and update callback

    useObject
    (
    person: Person
    person
    );
    return <
    import Listbox
    Listbox
    .
    const Item: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    item: Listbox.Option;
    current?: boolean;
    highlightOnHover?: boolean;
    children?: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Item

    A row (option) at least one block tall: without children, the option's icon, label and description; with them, the caller's parts, which the theme places by part (leading cells, text over description, then trailing cells) or, under Root columns, in order across the shared tracks. Pointer presses on a row control stay with the control: they neither select the row nor take focus from the control.

    Item
    item: Listbox.Option
    item
    ={{
    value: string
    value
    :
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    ,
    label: string
    label
    :
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    name: string
    name
    ,
    description?: string | undefined

    Second line of the default row.

    description
    :
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    email?: string | undefined
    email
    }} />;
    };
    type
    type PeopleListProps = {
    people: Person[];
    selected?: string;
    onSelect: (id: string) => void;
    }
    PeopleListProps
    = {
    people: Person[]
    people
    :
    class Person
    Person
    [];
    selected?: string | undefined
    selected
    ?: string;
    onSelect: (id: string) => void
    onSelect
    : (
    id: string
    id
    : string) => void;
    };
    const
    const PeopleList: ({ people, selected, onSelect }: PeopleListProps) => React.JSX.Element
    PeopleList
    = ({
    people: Person[]
    people
    ,
    selected: string | undefined
    selected
    ,
    onSelect: (id: string) => void
    onSelect
    }:
    type PeopleListProps = {
    people: Person[];
    selected?: string;
    onSelect: (id: string) => void;
    }
    PeopleListProps
    ) => (
    <
    import Listbox
    Listbox
    .
    const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onSelect">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    items: readonly Listbox.Option[];
    selectionMode?: Listbox.SelectionMode;
    value?: string[];
    defaultValue?: string[];
    onValueChange?: (value: string[]) => void;
    highlightedValue?: string | null;
    onHighlightChange?: (value: string | null) => void;
    ... 8 more ...;
    size?: Size;
    } & React.RefAttributes<...>>
    export Root

    Ark listbox: single, multiple or no selection, with keyboard navigation, typeahead and aria-selected from zag. A flex column that caps itself at its parent's height, so a long list scrolls in its Content.

    Root
    items: readonly Listbox.Option[]
    items
    ={
    people: Person[]
    people
    .
    Array<Person>.map<{
    value: string;
    label: string;
    }>(callbackfn: (value: Person, index: number, array: Person[]) => {
    value: string;
    label: string;
    }, thisArg?: any): {
    value: string;
    label: string;
    }[]

    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
    ((
    person: Person
    person
    ) => ({
    value: string
    value
    :
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    ,
    label: string
    label
    :
    person: Person
    person
    .
    name: string
    name
    }))}
    value?: string[] | undefined
    value
    ={
    selected: string | undefined
    selected
    ? [
    selected: string
    selected
    ] : []}
    onValueChange?: ((value: string[]) => void) | undefined
    onValueChange
    ={([
    id: string
    id
    ]) =>
    id: string
    id
    &&
    onSelect: (id: string) => void
    onSelect
    (
    id: string
    id
    )}
    >
    <
    import Listbox
    Listbox
    .
    const Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    children: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Viewport

    A thin overlay ScrollArea (decision 5) that grows to fill the Root, for a list that owns its scrolling (a picker, a fixed-height panel). Its Content is the scrolling element, so the thumb sits in the Content's end gutter. Omit it inside a host that already scrolls, which would otherwise trap wheel and trackpad gestures in a nested scroller.

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

    The listbox element: zag's content props with the grid keyboard in front of them, a Container's attributes so a Viewport's slot merges onto it, and the Root's virtual windowing over its direct children (the rows). Under a Viewport it is the scrolling element (inset gutter by default); otherwise its host scrolls and the rows inherit the host's rails (inherit). A windowed (virtual) list measures its scroller, so it needs a Viewport.

    Content
    "aria-label"?: string | undefined

    Defines a string value that labels the current element.

    @see ― aria-labelledby.

    aria-label
    ='Contacts'>
    {
    people: Person[]
    people
    .
    Array<Person>.map<React.JSX.Element>(callbackfn: (value: Person, index: number, array: Person[]) => React.JSX.Element, thisArg?: any): React.JSX.Element[]

    Calls a defined callback function on each element of an array, and returns an array that contains the results.

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

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

    map
    ((
    person: Person
    person
    ) => (
    <
    const PersonRow: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    A row that re-renders when its person is renamed.

    PersonRow
    Attributes.key?: React.Key | null | undefined
    key
    ={
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    }
    person: Person
    person
    ={
    person: Person
    person
    } />
    ))}
    </
    import Listbox
    Listbox
    .
    const Content: React.ForwardRefExoticComponent<Omit<Layout.ContainerProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLDivElement>>
    export Content

    The listbox element: zag's content props with the grid keyboard in front of them, a Container's attributes so a Viewport's slot merges onto it, and the Root's virtual windowing over its direct children (the rows). Under a Viewport it is the scrolling element (inset gutter by default); otherwise its host scrolls and the rows inherit the host's rails (inherit). A windowed (virtual) list measures its scroller, so it needs a Viewport.

    Content
    >
    </
    import Listbox
    Listbox
    .
    const Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    children: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Viewport

    A thin overlay ScrollArea (decision 5) that grows to fill the Root, for a list that owns its scrolling (a picker, a fixed-height panel). Its Content is the scrolling element, so the thumb sits in the Content's end gutter. Omit it inside a host that already scrolls, which would otherwise trap wheel and trackpad gestures in a nested scroller.

    Viewport
    >
    </
    import Listbox
    Listbox
    .
    const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onSelect">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    items: readonly Listbox.Option[];
    selectionMode?: Listbox.SelectionMode;
    value?: string[];
    defaultValue?: string[];
    onValueChange?: (value: string[]) => void;
    highlightedValue?: string | null;
    onHighlightChange?: (value: string | null) => void;
    ... 8 more ...;
    size?: Size;
    } & React.RefAttributes<...>>
    export Root

    Ark listbox: single, multiple or no selection, with keyboard navigation, typeahead and aria-selected from zag. A flex column that caps itself at its parent's height, so a long list scrolls in its Content.

    Root
    >
    );
    /** Re-renders when this person changes, here or on another peer. */
    const
    const PersonDetail: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    Re-renders when this person changes, here or on another peer.

    PersonDetail
    = ({
    person: Person
    person
    }: {
    person: Person
    person
    :
    class Person
    Person
    }) => {
    const [
    const snapshot: Obj.Snapshot<Person>
    snapshot
    ] =
    useObject<Person>(obj: Person): [Obj.Snapshot<Person>, ObjectUpdateCallback<Person>] (+9 overloads)

    Hook to subscribe to an entire Echo object. Returns a snapshot of the current object value and automatically re-renders when the object changes.

    @param ― obj - The Echo object to subscribe to (objects only, not relations)

    @returns ― The current object snapshot and update callback

    useObject
    (
    person: Person
    person
    );
    return (
    <
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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
    >{
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    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>, "style" | "role" | "children"> & 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
    >
    {
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    email?: string | undefined
    email
    && (
    <
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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'>{
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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 Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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
    >
    );
    };
  6. Edit with a schema form. ObjectForm builds its fields from Person’s schema: a text field for the name, an email field, and a picker of organizations for the employer. It writes each change to the object as it is made, so the dialog needs no Save button. We no longer need the editor from Inputs and actions.

    import {
    const useObject: {
    <T extends Obj.Unknown>(ref: Ref<T>): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined, options: LoadOptions): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T): [Obj.Snapshot<T>, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(objOrRef: T | Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T, property: K): [T[K], ObjectPropUpdateCallback<T[K]>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T>, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T> | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    }
    useObject
    ,
    const useQuery: UseQueryFn

    Create subscription.

    @param ― queryOrFilter - The query or filter to apply. Query is memoized based on the AST. No need to call useMemo.

    useQuery
    } from '@dxos/react-client/echo';
    import {
    const ObjectForm: ({ object, type, schema, showTags }: ObjectFormProps) => React.JSX.Element

    An object's properties (and meta tags) as a next Form in its host's grid, writing each change back.

    ObjectForm
    } from '@dxos/react-ui-form';
    import * as
    import Button
    Button
    from '@dxos/react-ui/Button';
    import * as
    import Dialog
    Dialog
    from '@dxos/react-ui/Dialog';
    11 collapsed lines
    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';
    import * as
    import Listbox
    Listbox
    from '@dxos/react-ui/Listbox';
    import * as
    import Panel
    Panel
    from '@dxos/react-ui/Panel';
    import * as
    import Status
    Status
    from '@dxos/react-ui/Status';
    import * as
    import Toolbar
    Toolbar
    from '@dxos/react-ui/Toolbar';
    import * as
    import Typography
    Typography
    from '@dxos/react-ui/Typography';
    import {
    const ns: "com.example.contacts"
    ns
    } from '../icons/translations.ts';
    import {
    const DeletePopover: ({ label, onDelete }: DeletePopoverProps) => React.JSX.Element
    DeletePopover
    } from '../overlays/ContactsScreen.tsx';
    import {
    class Person
    Person
    } from './schema.ts';
    49 collapsed lines
    const
    const people: Query.Query<Person & OfKind<EntityKind.Object>>
    people
    =
    import Query
    Query
    .
    const select: <Filter.Filter<Person & OfKind<EntityKind.Object>>>(filter: Filter.Filter<Person & OfKind<EntityKind.Object>>) => Query.Query<Person & OfKind<EntityKind.Object>>

    Select objects based on a filter.

    @param ― filter - Filter to select the objects.

    @returns ― Query for the selected objects.

    @performance ― O(1); wraps the current AST in a new immutable node without executing anything.

    select
    (
    import Filter
    Filter
    .
    const type: <typeof Person>(type: typeof Person, props?: Filter.Props<Person & OfKind<EntityKind.Object>> | undefined) => Filter.Filter<Person & OfKind<EntityKind.Object>> (+4 overloads)
    type
    (
    class Person
    Person
    )).
    Query<Person & OfKind<EntityKind.Object>>.orderBy(order_0: Order.Order<Person & OfKind<EntityKind.Object>>, ...order: Order.Order<Person & OfKind<EntityKind.Object>>[]): Query.Query<Person & OfKind<EntityKind.Object>>

    Order the query results. Orders are specified in priority order. The first order will be applied first, etc.

    Order.property orders by the current result shape's fields, so it works both before and after an

    aggregate

    : before, by member (row) properties; after, by the flat record's fields (any group or aggregate field — e.g. Order.property('lastMessageAt') reorders the groups by that aggregate).

    @param ― order - Order to sort the results.

    @returns ― Query for the ordered results.

    @performance ― O(k) in the number of orders; builds the AST without executing anything.

    orderBy
    (
    import Order
    Order
    .
    const property: <Person>(property: "~@dxos/echo/Kind" | "email" | "employer" | "name" | "id", direction: OrderDirection) => Order.Order<Person>

    Order by a property of the current result shape.

    @performance ― O(1); builds an order AST node without sorting anything.

    property
    <
    class Person
    Person
    >('name', 'asc'));
    /** A row that re-renders when its person is renamed. */
    const
    const PersonRow: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    A row that re-renders when its person is renamed.

    PersonRow
    = ({
    person: Person
    person
    }: {
    person: Person
    person
    :
    class Person
    Person
    }) => {
    const [
    const snapshot: Obj.Snapshot<Person>
    snapshot
    ] =
    useObject<Person>(obj: Person): [Obj.Snapshot<Person>, ObjectUpdateCallback<Person>] (+9 overloads)

    Hook to subscribe to an entire Echo object. Returns a snapshot of the current object value and automatically re-renders when the object changes.

    @param ― obj - The Echo object to subscribe to (objects only, not relations)

    @returns ― The current object snapshot and update callback

    useObject
    (
    person: Person
    person
    );
    return <
    import Listbox
    Listbox
    .
    const Item: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    item: Listbox.Option;
    current?: boolean;
    highlightOnHover?: boolean;
    children?: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Item

    A row (option) at least one block tall: without children, the option's icon, label and description; with them, the caller's parts, which the theme places by part (leading cells, text over description, then trailing cells) or, under Root columns, in order across the shared tracks. Pointer presses on a row control stay with the control: they neither select the row nor take focus from the control.

    Item
    item: Listbox.Option
    item
    ={{
    value: string
    value
    :
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    ,
    label: string
    label
    :
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    name: string
    name
    ,
    description?: string | undefined

    Second line of the default row.

    description
    :
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    email?: string | undefined
    email
    }} />;
    };
    type
    type PeopleListProps = {
    people: Person[];
    selected?: string;
    onSelect: (id: string) => void;
    }
    PeopleListProps
    = {
    people: Person[]
    people
    :
    class Person
    Person
    [];
    selected?: string | undefined
    selected
    ?: string;
    onSelect: (id: string) => void
    onSelect
    : (
    id: string
    id
    : string) => void;
    };
    const
    const PeopleList: ({ people, selected, onSelect }: PeopleListProps) => React.JSX.Element
    PeopleList
    = ({
    people: Person[]
    people
    ,
    selected: string | undefined
    selected
    ,
    onSelect: (id: string) => void
    onSelect
    }:
    type PeopleListProps = {
    people: Person[];
    selected?: string;
    onSelect: (id: string) => void;
    }
    PeopleListProps
    ) => (
    <
    import Listbox
    Listbox
    .
    const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onSelect">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    items: readonly Listbox.Option[];
    selectionMode?: Listbox.SelectionMode;
    value?: string[];
    defaultValue?: string[];
    onValueChange?: (value: string[]) => void;
    highlightedValue?: string | null;
    onHighlightChange?: (value: string | null) => void;
    ... 8 more ...;
    size?: Size;
    } & React.RefAttributes<...>>
    export Root

    Ark listbox: single, multiple or no selection, with keyboard navigation, typeahead and aria-selected from zag. A flex column that caps itself at its parent's height, so a long list scrolls in its Content.

    Root
    items: readonly Listbox.Option[]
    items
    ={
    people: Person[]
    people
    .
    Array<Person>.map<{
    value: string;
    label: string;
    }>(callbackfn: (value: Person, index: number, array: Person[]) => {
    value: string;
    label: string;
    }, thisArg?: any): {
    value: string;
    label: string;
    }[]

    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
    ((
    person: Person
    person
    ) => ({
    value: string
    value
    :
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    ,
    label: string
    label
    :
    person: Person
    person
    .
    name: string
    name
    }))}
    value?: string[] | undefined
    value
    ={
    selected: string | undefined
    selected
    ? [
    selected: string
    selected
    ] : []}
    onValueChange?: ((value: string[]) => void) | undefined
    onValueChange
    ={([
    id: string
    id
    ]) =>
    id: string
    id
    &&
    onSelect: (id: string) => void
    onSelect
    (
    id: string
    id
    )}
    >
    <
    import Listbox
    Listbox
    .
    const Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    children: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Viewport

    A thin overlay ScrollArea (decision 5) that grows to fill the Root, for a list that owns its scrolling (a picker, a fixed-height panel). Its Content is the scrolling element, so the thumb sits in the Content's end gutter. Omit it inside a host that already scrolls, which would otherwise trap wheel and trackpad gestures in a nested scroller.

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

    The listbox element: zag's content props with the grid keyboard in front of them, a Container's attributes so a Viewport's slot merges onto it, and the Root's virtual windowing over its direct children (the rows). Under a Viewport it is the scrolling element (inset gutter by default); otherwise its host scrolls and the rows inherit the host's rails (inherit). A windowed (virtual) list measures its scroller, so it needs a Viewport.

    Content
    "aria-label"?: string | undefined

    Defines a string value that labels the current element.

    @see ― aria-labelledby.

    aria-label
    ='Contacts'>
    {
    people: Person[]
    people
    .
    Array<Person>.map<React.JSX.Element>(callbackfn: (value: Person, index: number, array: Person[]) => React.JSX.Element, thisArg?: any): React.JSX.Element[]

    Calls a defined callback function on each element of an array, and returns an array that contains the results.

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

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

    map
    ((
    person: Person
    person
    ) => (
    <
    const PersonRow: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    A row that re-renders when its person is renamed.

    PersonRow
    Attributes.key?: React.Key | null | undefined
    key
    ={
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    }
    person: Person
    person
    ={
    person: Person
    person
    } />
    ))}
    </
    import Listbox
    Listbox
    .
    const Content: React.ForwardRefExoticComponent<Omit<Layout.ContainerProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLDivElement>>
    export Content

    The listbox element: zag's content props with the grid keyboard in front of them, a Container's attributes so a Viewport's slot merges onto it, and the Root's virtual windowing over its direct children (the rows). Under a Viewport it is the scrolling element (inset gutter by default); otherwise its host scrolls and the rows inherit the host's rails (inherit). A windowed (virtual) list measures its scroller, so it needs a Viewport.

    Content
    >
    </
    import Listbox
    Listbox
    .
    const Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    children: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Viewport

    A thin overlay ScrollArea (decision 5) that grows to fill the Root, for a list that owns its scrolling (a picker, a fixed-height panel). Its Content is the scrolling element, so the thumb sits in the Content's end gutter. Omit it inside a host that already scrolls, which would otherwise trap wheel and trackpad gestures in a nested scroller.

    Viewport
    >
    </
    import Listbox
    Listbox
    .
    const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onSelect">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    items: readonly Listbox.Option[];
    selectionMode?: Listbox.SelectionMode;
    value?: string[];
    defaultValue?: string[];
    onValueChange?: (value: string[]) => void;
    highlightedValue?: string | null;
    onHighlightChange?: (value: string | null) => void;
    ... 8 more ...;
    size?: Size;
    } & React.RefAttributes<...>>
    export Root

    Ark listbox: single, multiple or no selection, with keyboard navigation, typeahead and aria-selected from zag. A flex column that caps itself at its parent's height, so a long list scrolls in its Content.

    Root
    >
    );
    /** Re-renders when this person changes, here or on another peer. */
    const
    const PersonDetail: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    Re-renders when this person changes, here or on another peer.

    PersonDetail
    = ({
    person: Person
    person
    }: {
    person: Person
    person
    :
    class Person
    Person
    }) => {
    const [
    const snapshot: Obj.Snapshot<Person>
    snapshot
    ] =
    useObject<Person>(obj: Person): [Obj.Snapshot<Person>, ObjectUpdateCallback<Person>] (+9 overloads)

    Hook to subscribe to an entire Echo object. Returns a snapshot of the current object value and automatically re-renders when the object changes.

    @param ― obj - The Echo object to subscribe to (objects only, not relations)

    @returns ― The current object snapshot and update callback

    useObject
    (
    person: Person
    person
    );
    return (
    <
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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
    >{
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    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>, "style" | "role" | "children"> & 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
    >
    {
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    email?: string | undefined
    email
    && (
    <
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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'>{
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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 Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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
    >
    );
    };
    /** A form built from `Person`'s schema; each change is written to the object as it is made. */
    const
    const EditDialog: ({ label, person }: {
    label: string;
    person: Person;
    }) => React.JSX.Element

    A form built from Person's schema; each change is written to the object as it is made.

    EditDialog
    = ({
    label: string
    label
    ,
    person: Person
    person
    }: {
    label: string
    label
    : string;
    person: Person
    person
    :
    class Person
    Person
    }) => {
    const [
    const snapshot: Obj.Snapshot<Person>
    snapshot
    ] =
    useObject<Person>(obj: Person): [Obj.Snapshot<Person>, ObjectUpdateCallback<Person>] (+9 overloads)

    Hook to subscribe to an entire Echo object. Returns a snapshot of the current object value and automatically re-renders when the object changes.

    @param ― obj - The Echo object to subscribe to (objects only, not relations)

    @returns ― The current object snapshot and update callback

    useObject
    (
    person: Person
    person
    );
    return (
    <
    import Dialog
    Dialog
    .
    function Root({ lazyMount, unmountOnExit, closeOnInteractOutside, placement, ...props }: Dialog.RootProps): React.JSX.Element
    export Root
    Root
    >
    <
    import Dialog
    Dialog
    .
    const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>
    export Trigger

    Use asChild to open the dialog from a Button.

    Trigger
    PolymorphicProps.asChild?: boolean | undefined

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

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

    Leading icon.

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

    Visible text; children take precedence.

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

    label
    ={
    label: string
    label
    }
    iconOnly?: boolean | undefined

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

    iconOnly
    />
    </
    import Dialog
    Dialog
    .
    const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>
    export Trigger

    Use asChild to open the dialog from a Button.

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

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

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

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

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

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

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

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

    Body
    >
    <
    const ObjectForm: ({ object, type, schema, showTags }: ObjectFormProps) => React.JSX.Element

    An object's properties (and meta tags) as a next Form in its host's grid, writing each change back.

    ObjectForm
    type: AnyEntity
    type
    ={
    class Person
    Person
    }
    object: Obj.Unknown
    object
    ={
    person: Person
    person
    }
    showTags?: boolean | undefined

    Render the meta-tags field. Defaults to true.

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

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

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

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

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

    Dialog.Root takes no open now. With no Save to close the dialog, it can hold its own state. Form shows how to describe a form’s fields and how to edit an ECHO object with one.

  7. Write the screen. Add puts a new object in the database with db.add, and Delete takes it out with db.remove. Neither changes a list of our own. The query sees the change, and the list renders again.

    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 { type
    import Database
    Database
    ,
    import Filter
    Filter
    ,
    import Obj
    Obj
    ,
    import Order
    Order
    ,
    import Query
    Query
    } from '@dxos/echo';
    import {
    const useObject: {
    <T extends Obj.Unknown>(ref: Ref<T>): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(ref: Ref<T> | undefined, options: LoadOptions): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T): [Obj.Snapshot<T>, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(obj: T | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown>(objOrRef: T | Ref<T> | undefined): [Obj.Snapshot<T> | undefined, ObjectUpdateCallback<T>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T, property: K): [T[K], ObjectPropUpdateCallback<T[K]>];
    <T extends Obj.Unknown, K extends keyof T>(obj: T | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T>, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    <T, K extends keyof T>(ref: Ref<T> | undefined, property: K): [T[K] | undefined, ObjectPropUpdateCallback<T[K]>];
    }
    useObject
    ,
    const useQuery: UseQueryFn

    Create subscription.

    @param ― queryOrFilter - The query or filter to apply. Query is memoized based on the AST. No need to call useMemo.

    useQuery
    } from '@dxos/react-client/echo';
    1 collapsed line
    import {
    const ObjectForm: ({ object, type, schema, showTags }: ObjectFormProps) => React.JSX.Element

    An object's properties (and meta tags) as a next Form in its host's grid, writing each change back.

    ObjectForm
    } from '@dxos/react-ui-form';
    import * as
    import Button
    Button
    from '@dxos/react-ui/Button';
    1 collapsed line
    import * as
    import Dialog
    Dialog
    from '@dxos/react-ui/Dialog';
    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';
    1 collapsed line
    import * as
    import Listbox
    Listbox
    from '@dxos/react-ui/Listbox';
    import * as
    import Panel
    Panel
    from '@dxos/react-ui/Panel';
    import * as
    import Status
    Status
    from '@dxos/react-ui/Status';
    import * as
    import Toolbar
    Toolbar
    from '@dxos/react-ui/Toolbar';
    2 collapsed lines
    import * as
    import Typography
    Typography
    from '@dxos/react-ui/Typography';
    import {
    const ns: "com.example.contacts"
    ns
    } from '../icons/translations.ts';
    import {
    const DeletePopover: ({ label, onDelete }: DeletePopoverProps) => React.JSX.Element
    DeletePopover
    } from '../overlays/ContactsScreen.tsx';
    import {
    class Person
    Person
    } from './schema.ts';
    70 collapsed lines
    const
    const people: Query.Query<Person & OfKind<EntityKind.Object>>
    people
    =
    import Query
    Query
    .
    const select: <Filter.Filter<Person & OfKind<EntityKind.Object>>>(filter: Filter.Filter<Person & OfKind<EntityKind.Object>>) => Query.Query<Person & OfKind<EntityKind.Object>>

    Select objects based on a filter.

    @param ― filter - Filter to select the objects.

    @returns ― Query for the selected objects.

    @performance ― O(1); wraps the current AST in a new immutable node without executing anything.

    select
    (
    import Filter
    Filter
    .
    const type: <typeof Person>(type: typeof Person, props?: Filter.Props<Person & OfKind<EntityKind.Object>> | undefined) => Filter.Filter<Person & OfKind<EntityKind.Object>> (+4 overloads)
    type
    (
    class Person
    Person
    )).
    Query<Person & OfKind<EntityKind.Object>>.orderBy(order_0: Order.Order<Person & OfKind<EntityKind.Object>>, ...order: Order.Order<Person & OfKind<EntityKind.Object>>[]): Query.Query<Person & OfKind<EntityKind.Object>>

    Order the query results. Orders are specified in priority order. The first order will be applied first, etc.

    Order.property orders by the current result shape's fields, so it works both before and after an

    aggregate

    : before, by member (row) properties; after, by the flat record's fields (any group or aggregate field — e.g. Order.property('lastMessageAt') reorders the groups by that aggregate).

    @param ― order - Order to sort the results.

    @returns ― Query for the ordered results.

    @performance ― O(k) in the number of orders; builds the AST without executing anything.

    orderBy
    (
    import Order
    Order
    .
    const property: <Person>(property: "~@dxos/echo/Kind" | "email" | "employer" | "name" | "id", direction: OrderDirection) => Order.Order<Person>

    Order by a property of the current result shape.

    @performance ― O(1); builds an order AST node without sorting anything.

    property
    <
    class Person
    Person
    >('name', 'asc'));
    /** A row that re-renders when its person is renamed. */
    const
    const PersonRow: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    A row that re-renders when its person is renamed.

    PersonRow
    = ({
    person: Person
    person
    }: {
    person: Person
    person
    :
    class Person
    Person
    }) => {
    const [
    const snapshot: Obj.Snapshot<Person>
    snapshot
    ] =
    useObject<Person>(obj: Person): [Obj.Snapshot<Person>, ObjectUpdateCallback<Person>] (+9 overloads)

    Hook to subscribe to an entire Echo object. Returns a snapshot of the current object value and automatically re-renders when the object changes.

    @param ― obj - The Echo object to subscribe to (objects only, not relations)

    @returns ― The current object snapshot and update callback

    useObject
    (
    person: Person
    person
    );
    return <
    import Listbox
    Listbox
    .
    const Item: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    item: Listbox.Option;
    current?: boolean;
    highlightOnHover?: boolean;
    children?: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Item

    A row (option) at least one block tall: without children, the option's icon, label and description; with them, the caller's parts, which the theme places by part (leading cells, text over description, then trailing cells) or, under Root columns, in order across the shared tracks. Pointer presses on a row control stay with the control: they neither select the row nor take focus from the control.

    Item
    item: Listbox.Option
    item
    ={{
    value: string
    value
    :
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    ,
    label: string
    label
    :
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    name: string
    name
    ,
    description?: string | undefined

    Second line of the default row.

    description
    :
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    email?: string | undefined
    email
    }} />;
    };
    type
    type PeopleListProps = {
    people: Person[];
    selected?: string;
    onSelect: (id: string) => void;
    }
    PeopleListProps
    = {
    people: Person[]
    people
    :
    class Person
    Person
    [];
    selected?: string | undefined
    selected
    ?: string;
    onSelect: (id: string) => void
    onSelect
    : (
    id: string
    id
    : string) => void;
    };
    const
    const PeopleList: ({ people, selected, onSelect }: PeopleListProps) => React.JSX.Element
    PeopleList
    = ({
    people: Person[]
    people
    ,
    selected: string | undefined
    selected
    ,
    onSelect: (id: string) => void
    onSelect
    }:
    type PeopleListProps = {
    people: Person[];
    selected?: string;
    onSelect: (id: string) => void;
    }
    PeopleListProps
    ) => (
    <
    import Listbox
    Listbox
    .
    const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onSelect">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    items: readonly Listbox.Option[];
    selectionMode?: Listbox.SelectionMode;
    value?: string[];
    defaultValue?: string[];
    onValueChange?: (value: string[]) => void;
    highlightedValue?: string | null;
    onHighlightChange?: (value: string | null) => void;
    ... 8 more ...;
    size?: Size;
    } & React.RefAttributes<...>>
    export Root

    Ark listbox: single, multiple or no selection, with keyboard navigation, typeahead and aria-selected from zag. A flex column that caps itself at its parent's height, so a long list scrolls in its Content.

    Root
    items: readonly Listbox.Option[]
    items
    ={
    people: Person[]
    people
    .
    Array<Person>.map<{
    value: string;
    label: string;
    }>(callbackfn: (value: Person, index: number, array: Person[]) => {
    value: string;
    label: string;
    }, thisArg?: any): {
    value: string;
    label: string;
    }[]

    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
    ((
    person: Person
    person
    ) => ({
    value: string
    value
    :
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    ,
    label: string
    label
    :
    person: Person
    person
    .
    name: string
    name
    }))}
    value?: string[] | undefined
    value
    ={
    selected: string | undefined
    selected
    ? [
    selected: string
    selected
    ] : []}
    onValueChange?: ((value: string[]) => void) | undefined
    onValueChange
    ={([
    id: string
    id
    ]) =>
    id: string
    id
    &&
    onSelect: (id: string) => void
    onSelect
    (
    id: string
    id
    )}
    >
    <
    import Listbox
    Listbox
    .
    const Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    children: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Viewport

    A thin overlay ScrollArea (decision 5) that grows to fill the Root, for a list that owns its scrolling (a picker, a fixed-height panel). Its Content is the scrolling element, so the thumb sits in the Content's end gutter. Omit it inside a host that already scrolls, which would otherwise trap wheel and trackpad gestures in a nested scroller.

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

    The listbox element: zag's content props with the grid keyboard in front of them, a Container's attributes so a Viewport's slot merges onto it, and the Root's virtual windowing over its direct children (the rows). Under a Viewport it is the scrolling element (inset gutter by default); otherwise its host scrolls and the rows inherit the host's rails (inherit). A windowed (virtual) list measures its scroller, so it needs a Viewport.

    Content
    "aria-label"?: string | undefined

    Defines a string value that labels the current element.

    @see ― aria-labelledby.

    aria-label
    ='Contacts'>
    {
    people: Person[]
    people
    .
    Array<Person>.map<React.JSX.Element>(callbackfn: (value: Person, index: number, array: Person[]) => React.JSX.Element, thisArg?: any): React.JSX.Element[]

    Calls a defined callback function on each element of an array, and returns an array that contains the results.

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

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

    map
    ((
    person: Person
    person
    ) => (
    <
    const PersonRow: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    A row that re-renders when its person is renamed.

    PersonRow
    Attributes.key?: React.Key | null | undefined
    key
    ={
    person: Person
    person
    .
    OfKind<K extends Kind>.id: string
    id
    }
    person: Person
    person
    ={
    person: Person
    person
    } />
    ))}
    </
    import Listbox
    Listbox
    .
    const Content: React.ForwardRefExoticComponent<Omit<Layout.ContainerProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLDivElement>>
    export Content

    The listbox element: zag's content props with the grid keyboard in front of them, a Container's attributes so a Viewport's slot merges onto it, and the Root's virtual windowing over its direct children (the rows). Under a Viewport it is the scrolling element (inset gutter by default); otherwise its host scrolls and the rows inherit the host's rails (inherit). A windowed (virtual) list measures its scroller, so it needs a Viewport.

    Content
    >
    </
    import Listbox
    Listbox
    .
    const Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    children: React.ReactNode;
    } & React.RefAttributes<HTMLDivElement>>
    export Viewport

    A thin overlay ScrollArea (decision 5) that grows to fill the Root, for a list that owns its scrolling (a picker, a fixed-height panel). Its Content is the scrolling element, so the thumb sits in the Content's end gutter. Omit it inside a host that already scrolls, which would otherwise trap wheel and trackpad gestures in a nested scroller.

    Viewport
    >
    </
    import Listbox
    Listbox
    .
    const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onSelect">, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & {
    items: readonly Listbox.Option[];
    selectionMode?: Listbox.SelectionMode;
    value?: string[];
    defaultValue?: string[];
    onValueChange?: (value: string[]) => void;
    highlightedValue?: string | null;
    onHighlightChange?: (value: string | null) => void;
    ... 8 more ...;
    size?: Size;
    } & React.RefAttributes<...>>
    export Root

    Ark listbox: single, multiple or no selection, with keyboard navigation, typeahead and aria-selected from zag. A flex column that caps itself at its parent's height, so a long list scrolls in its Content.

    Root
    >
    );
    /** Re-renders when this person changes, here or on another peer. */
    const
    const PersonDetail: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    Re-renders when this person changes, here or on another peer.

    PersonDetail
    = ({
    person: Person
    person
    }: {
    person: Person
    person
    :
    class Person
    Person
    }) => {
    const [
    const snapshot: Obj.Snapshot<Person>
    snapshot
    ] =
    useObject<Person>(obj: Person): [Obj.Snapshot<Person>, ObjectUpdateCallback<Person>] (+9 overloads)

    Hook to subscribe to an entire Echo object. Returns a snapshot of the current object value and automatically re-renders when the object changes.

    @param ― obj - The Echo object to subscribe to (objects only, not relations)

    @returns ― The current object snapshot and update callback

    useObject
    (
    person: Person
    person
    );
    return (
    <
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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
    >{
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    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>, "style" | "role" | "children"> & 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
    >
    {
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    email?: string | undefined
    email
    && (
    <
    import Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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'>{
    const snapshot: Obj.Snapshot<Person>
    snapshot
    .
    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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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 Layout
    Layout
    .
    const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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
    >
    );
    };
    /** A form built from `Person`'s schema; each change is written to the object as it is made. */
    const
    const EditDialog: ({ label, person }: {
    label: string;
    person: Person;
    }) => React.JSX.Element

    A form built from Person's schema; each change is written to the object as it is made.

    EditDialog
    = ({
    label: string
    label
    ,
    person: Person
    person
    }: {
    label: string
    label
    : string;
    person: Person
    person
    :
    class Person
    Person
    }) => {
    const [
    const snapshot: Obj.Snapshot<Person>
    snapshot
    ] =
    useObject<Person>(obj: Person): [Obj.Snapshot<Person>, ObjectUpdateCallback<Person>] (+9 overloads)

    Hook to subscribe to an entire Echo object. Returns a snapshot of the current object value and automatically re-renders when the object changes.

    @param ― obj - The Echo object to subscribe to (objects only, not relations)

    @returns ― The current object snapshot and update callback

    useObject
    (
    person: Person
    person
    );
    return (
    <
    import Dialog
    Dialog
    .
    function Root({ lazyMount, unmountOnExit, closeOnInteractOutside, placement, ...props }: Dialog.RootProps): React.JSX.Element
    export Root
    Root
    >
    <
    import Dialog
    Dialog
    .
    const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>
    export Trigger

    Use asChild to open the dialog from a Button.

    Trigger
    PolymorphicProps.asChild?: boolean | undefined

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

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

    Leading icon.

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

    Visible text; children take precedence.

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

    label
    ={
    label: string
    label
    }
    iconOnly?: boolean | undefined

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

    iconOnly
    />
    </
    import Dialog
    Dialog
    .
    const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>
    export Trigger

    Use asChild to open the dialog from a Button.

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

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

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

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

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

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

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

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

    Body
    >
    <
    const ObjectForm: ({ object, type, schema, showTags }: ObjectFormProps) => React.JSX.Element

    An object's properties (and meta tags) as a next Form in its host's grid, writing each change back.

    ObjectForm
    type: AnyEntity
    type
    ={
    class Person
    Person
    }
    object: Obj.Unknown
    object
    ={
    person: Person
    person
    }
    showTags?: boolean | undefined

    Render the meta-tags field. Defaults to true.

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

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

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

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

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

    ECHO Database interface.

    Database
    }) => {
    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: Entity<Person & OfKind<EntityKind.Object>>[]
    contacts
    =
    useQuery<Query.Query<Person & OfKind<EntityKind.Object>>, Entity<Person & OfKind<EntityKind.Object>>>(resource: Database.Queryable | undefined, query: Query.Query<Person & OfKind<EntityKind.Object>>): Entity<Person & OfKind<EntityKind.Object>>[] (+3 overloads)

    Create subscription.

    @param ― queryOrFilter - The query or filter to apply. Query is memoized based on the AST. No need to call useMemo.

    useQuery
    (
    db: Database.Database
    db
    ,
    const people: Query.Query<Person & OfKind<EntityKind.Object>>
    people
    );
    const [
    const selected: string | undefined
    selected
    ,
    const setSelected: React.Dispatch<React.SetStateAction<string | undefined>>
    setSelected
    ] =
    useState<string>(): [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>();
    const
    const person: Entity<Person & OfKind<EntityKind.Object>> | undefined
    person
    =
    const contacts: Entity<Person & OfKind<EntityKind.Object>>[]
    contacts
    .
    Array<Entity<Person & OfKind<EntityKind.Object>>>.find(predicate: (value: Entity<Person & OfKind<EntityKind.Object>>, index: number, obj: Entity<Person & OfKind<EntityKind.Object>>[]) => unknown, thisArg?: any): Entity<Person & OfKind<EntityKind.Object>> | 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 name: string
    name
    : string =
    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');
    const
    const person: BaseObj & Person & OfKind<EntityKind.Object>
    person
    =
    db: Database.Database
    db
    .
    Database.add<BaseObj & Person & OfKind<EntityKind.Object>>(obj: BaseObj & Person & OfKind<EntityKind.Object>, opts?: Database.AddOptions): BaseObj & Person & OfKind<EntityKind.Object>

    Adds an object or relation to the database.

    Only Object and Relation entities are accepted. To persist a Type definition use

    addType

    — passing a Type entity is rejected at compile time (and at runtime).

    Pass { to: feed } to append to a feed instead (synchronous; confirm with

    flush

    ).

    @performance ― Synchronous; O(n) in object size to write it into a new linked document (or the root), persisted in the background.

    add
    (
    import Obj
    Obj
    .
    function make<typeof Person>(type: typeof Person, props: NoInfer<Obj.MakeProps<typeof Person>>, options?: Obj.MakeOptions): Obj.OfShape<Person & OfKind<EntityKind.Object>>

    Creates a new echo object of the given schema or Type.Type.

    @param ― typeOrSchema - A static object schema (Type.makeObject(...)) or a Type.Type entity (e.g. one returned by db.addType(schemaEntity)).

    @param ― props - Object properties.

    @param ―

    options - See MakeOptions.

    Meta can be passed as a symbol in props.

    Example:

    const obj = Obj.make(Person, { [Obj.Meta]: { keys: [...] }, name: 'John' });

    Note: Only accepts object schemas / object-kind types, not relation schemas. Use Relation.make for relations.

    @performance ― O(n) in props size; validates props against the schema and allocates a reactive proxy, with no database I/O.

    make
    (
    class Person
    Person
    , {
    name: string
    name
    }));
    const setSelected: (value: React.SetStateAction<string | undefined>) => void
    setSelected
    (
    const person: BaseObj & Person & OfKind<EntityKind.Object>
    person
    .
    id: string
    id
    );
    };
    const
    const handleDelete: (person: Person) => void
    handleDelete
    = (
    person: Person
    person
    :
    class Person
    Person
    ) => {
    db: Database.Database
    db
    .
    Database.remove(obj: Unknown, opts?: Database.WriteOptions): void

    Removes object from the database.

    @performance ― O(1); sets the deletion marker (a soft delete).

    remove
    (
    person: Person
    person
    );
    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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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: Entity<Person & OfKind<EntityKind.Object>>[]
    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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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 person: Entity<Person & OfKind<EntityKind.Object>> | undefined
    person
    && <
    const EditDialog: ({ label, person }: {
    label: string;
    person: Person;
    }) => React.JSX.Element

    A form built from Person's schema; each change is written to the object as it is made.

    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')}
    person: Person
    person
    ={
    const person: Entity<Person & OfKind<EntityKind.Object>>
    person
    } />}
    {
    const person: Entity<Person & OfKind<EntityKind.Object>> | undefined
    person
    && <
    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: (person: Person) => void
    handleDelete
    (
    const person: Entity<Person & OfKind<EntityKind.Object>>
    person
    )} />}
    </
    import Toolbar
    Toolbar
    .
    const Root: React.ForwardRefExoticComponent<Omit<Toolbar.RootProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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 PeopleList: ({ people, selected, onSelect }: PeopleListProps) => React.JSX.Element
    PeopleList
    people: Person[]
    people
    ={
    const contacts: Entity<Person & OfKind<EntityKind.Object>>[]
    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 person: Entity<Person & OfKind<EntityKind.Object>> | undefined
    person
    ? (
    <
    const PersonDetail: ({ person }: {
    person: Person;
    }) => React.JSX.Element

    Re-renders when this person changes, here or on another peer.

    PersonDetail
    person: Person
    person
    ={
    const person: Entity<Person & OfKind<EntityKind.Object>>
    person
    } />
    ) : (
    <
    import Status
    Status
    .
    const Empty: React.ForwardRefExoticComponent<Omit<Status.EmptyProps, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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
    >
    )}
    </
    import Layout
    Layout
    .
    const Grid: React.ForwardRefExoticComponent<Omit<Layout.GridProps & {
    asChild?: boolean;
    }, "className"> & {
    classNames?: import("@dxos/ui-types").ClassNameValue;
    } & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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>, "style" | "role" | "children"> & 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
    >
    );
    };

    const contacts = useQuery(db, people) is the line that replaces useState(CONTACTS). One useState is left, and it holds selected, the id of the chosen person, which handleAdd and handleDelete still set.

  8. Open a space. A space is a database that its members share, and an identity owns the spaces it creates. The first time the app runs, setUp creates an identity and then a space. Contacts shows the screen once the space is there.

    Add src/echo/main.tsx, starting with the same stylesheet imports as the first entry point, import '@dxos-theme'; and import '@dxos/react-ui/theme.css';:

    import { type
    class Client

    The Client class encapsulates the core client-side API of DXOS.

    Client
    } from '@dxos/client';
    2 collapsed lines
    import {
    class Config

    Global configuration object. NOTE: Config objects are immutable.

    Config
    } from '@dxos/config';
    import {
    const ClientProvider: React.ForwardRefExoticComponent<Omit<ClientOptions, "config" | "services"> & Pick<ClientContextProps, "status"> & {
    client?: Client | Provider<Promise<Client>>;
    config?: Config | Provider<Promise<Config>>;
    services?: ClientServicesProvider | ((config?: Config) => MaybePromise<ClientServicesProvider>);
    fallback?: React.FunctionComponent<Partial<ClientContextProps>>;
    suspend?: boolean;
    noBanner?: boolean;
    onInitialized?: (client: Client) => MaybePromise<void>;
    } & {
    ...;
    } & React.RefAttributes<...>>

    Root component that provides the DXOS client instance to child components. To be used with the useClient hook.

    ClientProvider
    } from '@dxos/react-client';
    import {
    const useSpaces: ({ all }?: UseSpacesProps) => Space[]

    Get all Spaces available to current user. Requires a ClientProvider somewhere in the parent tree. By default, only ready spaces are returned.

    @returns ― an array of Spaces.

    useSpaces
    } from '@dxos/react-client/echo';
    6 collapsed lines
    import '@dxos/react-ui/theme.css';
    import {
    const translations: [{
    readonly 'en-US': {
    readonly "@dxos/react-ui-form": {
    readonly "ref-editor.placeholder": "Type '@' to add a reference, or enter a value";
    readonly "ref-editor-auto.placeholder": "Search by name, or enter a value";
    readonly "fields.label": "Fields";
    readonly "hidden-fields.label": "Hidden Fields";
    readonly "empty-readonly-ref-field.label": "(none)";
    readonly "field-property.label": "Property";
    readonly "field-property.placeholder": "Property name";
    readonly "field-format.label": "Type";
    readonly "field-path.label": "Field path";
    readonly "remove-item.button": "Delete item";
    readonly "add-item.button": "Add item";
    readonly "add-property-button.label": "Add property";
    readonly "boolean-input-true.value": "Yes";
    readonly "boolean-input-false.value": "No";
    readonly "indeterminate.placeholder": "Mixed";
    readonly "select-none.label": "None";
    readonly "show-field.label": "Show field";
    readonly "hide-field.label": "Hide field";
    readonly "delete-field.label": "Delete field";
    readonly "create-option.label": "Create";
    readonly "add-tag.label": "Add tag";
    readonly "add-tag-query.label": "Add tag \u201C{{text}}\u201D";
    readonly "ref-field-combobox-input.placeholder": "Search\u2026";
    readonly "ref-field.placeholder": "Select\u2026";
    readonly "ref-field.placeholder_one": "Select\u2026";
    readonly "ref-field.placeholder_other": "Select items\u2026";
    readonly "untitled.label": "Untitled";
    readonly "example.placeholder": "Example";
    readonly "select.placeholder": "Select\u2026";
    readonly "latitude.placeholder": "Latitude (e.g., 40.7128)";
    readonly "longitude.placeholder": "Longitude (e.g., -74.0060)";
    readonly "cancel-button.label": "Cancel";
    readonly "save-button.label": "Save";
    readonly "create-text.label": "Create text";
    readonly "format.boolean.label": "Boolean";
    readonly "format.currency.label": "Currency";
    readonly "format.date.label": "Date";
    readonly "format.date-time.label": "DateTime";
    readonly "format.did.label": "DID";
    readonly "format.duration.label": "Duration";
    readonly "format.dxn.label": "DXN";
    readonly "format.email.label": "Email";
    readonly "format.formula.label": "Formula";
    readonly "format.hostname.label": "Hostname";
    readonly "format.integer.label": "Integer";
    readonly "format.json.label": "JSON";
    readonly "format.lnglat.label": "Geopoint";
    readonly "format.markdown.label": "Markdown";
    readonly "format.password.label": "Password";
    readonly "format.percent.label": "Percent";
    readonly "format.ref.label": "Reference";
    readonly "format.regex.label": "RegExp";
    readonly "format.string.label": "String";
    readonly "format.single-select.label": "Select";
    readonly "format.multi-select.label": "Multi-select";
    readonly "format.text.label": "Long text";
    readonly "format.time.label": "Time";
    readonly "format.timestamp.label": "Timestamp";
    readonly "format.user.label": "User";
    readonly "format.number.label": "Number";
    readonly "format.uri.label": "URI";
    readonly "format.url.label": "URL";
    readonly "format.uuid.label": "UUID";
    readonly "latitude.label": "Latitude";
    readonly "longitude.label": "Longitude";
    readonly "select-option.label": "Label";
    readonly "select-option-label.placeholder": "Option label";
    readonly "select-option-color.label": "Color";
    readonly "select-option-delete.button": "Delete";
    readonly "select-option-add.button": "Add option";
    readonly "system-schema.title": "System type";
    readonly "system-schema.description": "System type: cannot add or remove fields.";
    readonly "remove.button": "Delete";
    };
    };
    }]
    translations
    as
    const formTranslations: [{
    readonly 'en-US': {
    readonly "@dxos/react-ui-form": {
    readonly "ref-editor.placeholder": "Type '@' to add a reference, or enter a value";
    readonly "ref-editor-auto.placeholder": "Search by name, or enter a value";
    readonly "fields.label": "Fields";
    readonly "hidden-fields.label": "Hidden Fields";
    readonly "empty-readonly-ref-field.label": "(none)";
    readonly "field-property.label": "Property";
    readonly "field-property.placeholder": "Property name";
    readonly "field-format.label": "Type";
    readonly "field-path.label": "Field path";
    readonly "remove-item.button": "Delete item";
    readonly "add-item.button": "Add item";
    readonly "add-property-button.label": "Add property";
    readonly "boolean-input-true.value": "Yes";
    readonly "boolean-input-false.value": "No";
    readonly "indeterminate.placeholder": "Mixed";
    readonly "select-none.label": "None";
    readonly "show-field.label": "Show field";
    readonly "hide-field.label": "Hide field";
    readonly "delete-field.label": "Delete field";
    readonly "create-option.label": "Create";
    readonly "add-tag.label": "Add tag";
    readonly "add-tag-query.label": "Add tag \u201C{{text}}\u201D";
    readonly "ref-field-combobox-input.placeholder": "Search\u2026";
    readonly "ref-field.placeholder": "Select\u2026";
    readonly "ref-field.placeholder_one": "Select\u2026";
    readonly "ref-field.placeholder_other": "Select items\u2026";
    readonly "untitled.label": "Untitled";
    readonly "example.placeholder": "Example";
    readonly "select.placeholder": "Select\u2026";
    readonly "latitude.placeholder": "Latitude (e.g., 40.7128)";
    readonly "longitude.placeholder": "Longitude (e.g., -74.0060)";
    readonly "cancel-button.label": "Cancel";
    readonly "save-button.label": "Save";
    readonly "create-text.label": "Create text";
    readonly "format.boolean.label": "Boolean";
    readonly "format.currency.label": "Currency";
    readonly "format.date.label": "Date";
    readonly "format.date-time.label": "DateTime";
    readonly "format.did.label": "DID";
    readonly "format.duration.label": "Duration";
    readonly "format.dxn.label": "DXN";
    readonly "format.email.label": "Email";
    readonly "format.formula.label": "Formula";
    readonly "format.hostname.label": "Hostname";
    readonly "format.integer.label": "Integer";
    readonly "format.json.label": "JSON";
    readonly "format.lnglat.label": "Geopoint";
    readonly "format.markdown.label": "Markdown";
    readonly "format.password.label": "Password";
    readonly "format.percent.label": "Percent";
    readonly "format.ref.label": "Reference";
    readonly "format.regex.label": "RegExp";
    readonly "format.string.label": "String";
    readonly "format.single-select.label": "Select";
    readonly "format.multi-select.label": "Multi-select";
    readonly "format.text.label": "Long text";
    readonly "format.time.label": "Time";
    readonly "format.timestamp.label": "Timestamp";
    readonly "format.user.label": "User";
    readonly "format.number.label": "Number";
    readonly "format.uri.label": "URI";
    readonly "format.url.label": "URL";
    readonly "format.uuid.label": "UUID";
    readonly "latitude.label": "Latitude";
    readonly "longitude.label": "Longitude";
    readonly "select-option.label": "Label";
    readonly "select-option-label.placeholder": "Option label";
    readonly "select-option-color.label": "Color";
    readonly "select-option-delete.button": "Delete";
    readonly "select-option-add.button": "Add option";
    readonly "system-schema.title": "System type";
    readonly "system-schema.description": "System type: cannot add or remove fields.";
    readonly "remove.button": "Delete";
    };
    };
    }]
    formTranslations
    } from '@dxos/react-ui-form/translations';
    import * as
    import Theme
    Theme
    from '@dxos/react-ui/Theme';
    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 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';
    import {
    const ContactsScreen: ({ db }: {
    db: Database;
    }) => React.JSX.Element
    ContactsScreen
    } from './ContactsScreen.tsx';
    2 collapsed lines
    import {
    class Organization
    Organization
    ,
    class Person
    Person
    } from './schema.ts';
    /** Gives the app an identity the first time it runs, and a space to keep the contacts in. */
    const
    const setUp: (client: Client) => Promise<void>

    Gives the app an identity the first time it runs, and a space to keep the contacts in.

    setUp
    = async (
    client: Client
    client
    :
    class Client

    The Client class encapsulates the core client-side API of DXOS.

    Client
    ) => {
    if (!
    client: Client
    client
    .
    Client.halo: Halo

    HALO credentials.

    halo
    .
    Halo.identity: MulticastObservable<Identity | null>
    identity
    .
    MulticastObservable<Identity | null>.get(): Identity | null

    Get the current value of the observable.

    get
    ()) {
    await
    client: Client
    client
    .
    Client.halo: Halo

    HALO credentials.

    halo
    .
    Halo.createIdentity(options?: ProfileDocument, deviceProfile?: DeviceProfileDocument): Promise<Identity>
    createIdentity
    ();
    }
    if (
    client: Client
    client
    .
    Client.spaces: Echo

    ECHO Spaces.

    spaces
    .
    Echo.get(): Space[] (+2 overloads)

    Returns the list of spaces.

    get
    ().
    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
    === 0) {
    await
    client: Client
    client
    .
    Client.spaces: Echo

    ECHO Spaces.

    spaces
    .
    Echo.create(props?: Pick<SpaceProperties, "name" | "hue" | "icon" | "invocationTraceFeed">, options?: CreateSpaceOptions): Promise<Space>

    Creates a new space.

    create
    ({
    name?: string | undefined
    name
    : 'Contacts' });
    }
    };
    /** Shows the screen once the space is there. */
    const
    const Contacts: () => React.JSX.Element | null

    Shows the screen once the space is there.

    Contacts
    = () => {
    const [
    const space: Space
    space
    ] =
    function useSpaces({ all }?: UseSpacesProps): Space[]

    Get all Spaces available to current user. Requires a ClientProvider somewhere in the parent tree. By default, only ready spaces are returned.

    @returns ― an array of Spaces.

    useSpaces
    ();
    return
    const space: Space
    space
    ? <
    const ContactsScreen: ({ db }: {
    db: Database;
    }) => React.JSX.Element
    ContactsScreen
    db: Database
    db
    ={
    const space: Space
    space
    .
    Space.db: EchoDatabase

    Echo database.

    db
    } /> : null;
    };
  9. Render it inside the client. ClientProvider starts ECHO with the types the app uses, and runs setUp once the client is ready. Its config is the one from ECHO’s Installation page. The config keeps the data across reloads, and reaches other devices through EDGE, the always-online peer that DXOS runs.

    The theme provider goes inside it, and now also registers @dxos/react-ui-form’s strings:

    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 { type
    class Client

    The Client class encapsulates the core client-side API of DXOS.

    Client
    } from '@dxos/client';
    import {
    class Config

    Global configuration object. NOTE: Config objects are immutable.

    Config
    } from '@dxos/config';
    import {
    const ClientProvider: React.ForwardRefExoticComponent<Omit<ClientOptions, "config" | "services"> & Pick<ClientContextProps, "status"> & {
    client?: Client | Provider<Promise<Client>>;
    config?: Config | Provider<Promise<Config>>;
    services?: ClientServicesProvider | ((config?: Config) => MaybePromise<ClientServicesProvider>);
    fallback?: React.FunctionComponent<Partial<ClientContextProps>>;
    suspend?: boolean;
    noBanner?: boolean;
    onInitialized?: (client: Client) => MaybePromise<void>;
    } & {
    ...;
    } & React.RefAttributes<...>>

    Root component that provides the DXOS client instance to child components. To be used with the useClient hook.

    ClientProvider
    } from '@dxos/react-client';
    3 collapsed lines
    import {
    const useSpaces: ({ all }?: UseSpacesProps) => Space[]

    Get all Spaces available to current user. Requires a ClientProvider somewhere in the parent tree. By default, only ready spaces are returned.

    @returns ― an array of Spaces.

    useSpaces
    } from '@dxos/react-client/echo';
    import '@dxos/react-ui/theme.css';
    import {
    const translations: [{
    readonly 'en-US': {
    readonly "@dxos/react-ui-form": {
    readonly "ref-editor.placeholder": "Type '@' to add a reference, or enter a value";
    readonly "ref-editor-auto.placeholder": "Search by name, or enter a value";
    readonly "fields.label": "Fields";
    readonly "hidden-fields.label": "Hidden Fields";
    readonly "empty-readonly-ref-field.label": "(none)";
    readonly "field-property.label": "Property";
    readonly "field-property.placeholder": "Property name";
    readonly "field-format.label": "Type";
    readonly "field-path.label": "Field path";
    readonly "remove-item.button": "Delete item";
    readonly "add-item.button": "Add item";
    readonly "add-property-button.label": "Add property";
    readonly "boolean-input-true.value": "Yes";
    readonly "boolean-input-false.value": "No";
    readonly "indeterminate.placeholder": "Mixed";
    readonly "select-none.label": "None";
    readonly "show-field.label": "Show field";
    readonly "hide-field.label": "Hide field";
    readonly "delete-field.label": "Delete field";
    readonly "create-option.label": "Create";
    readonly "add-tag.label": "Add tag";
    readonly "add-tag-query.label": "Add tag \u201C{{text}}\u201D";
    readonly "ref-field-combobox-input.placeholder": "Search\u2026";
    readonly "ref-field.placeholder": "Select\u2026";
    readonly "ref-field.placeholder_one": "Select\u2026";
    readonly "ref-field.placeholder_other": "Select items\u2026";
    readonly "untitled.label": "Untitled";
    readonly "example.placeholder": "Example";
    readonly "select.placeholder": "Select\u2026";
    readonly "latitude.placeholder": "Latitude (e.g., 40.7128)";
    readonly "longitude.placeholder": "Longitude (e.g., -74.0060)";
    readonly "cancel-button.label": "Cancel";
    readonly "save-button.label": "Save";
    readonly "create-text.label": "Create text";
    readonly "format.boolean.label": "Boolean";
    readonly "format.currency.label": "Currency";
    readonly "format.date.label": "Date";
    readonly "format.date-time.label": "DateTime";
    readonly "format.did.label": "DID";
    readonly "format.duration.label": "Duration";
    readonly "format.dxn.label": "DXN";
    readonly "format.email.label": "Email";
    readonly "format.formula.label": "Formula";
    readonly "format.hostname.label": "Hostname";
    readonly "format.integer.label": "Integer";
    readonly "format.json.label": "JSON";
    readonly "format.lnglat.label": "Geopoint";
    readonly "format.markdown.label": "Markdown";
    readonly "format.password.label": "Password";
    readonly "format.percent.label": "Percent";
    readonly "format.ref.label": "Reference";
    readonly "format.regex.label": "RegExp";
    readonly "format.string.label": "String";
    readonly "format.single-select.label": "Select";
    readonly "format.multi-select.label": "Multi-select";
    readonly "format.text.label": "Long text";
    readonly "format.time.label": "Time";
    readonly "format.timestamp.label": "Timestamp";
    readonly "format.user.label": "User";
    readonly "format.number.label": "Number";
    readonly "format.uri.label": "URI";
    readonly "format.url.label": "URL";
    readonly "format.uuid.label": "UUID";
    readonly "latitude.label": "Latitude";
    readonly "longitude.label": "Longitude";
    readonly "select-option.label": "Label";
    readonly "select-option-label.placeholder": "Option label";
    readonly "select-option-color.label": "Color";
    readonly "select-option-delete.button": "Delete";
    readonly "select-option-add.button": "Add option";
    readonly "system-schema.title": "System type";
    readonly "system-schema.description": "System type: cannot add or remove fields.";
    readonly "remove.button": "Delete";
    };
    };
    }]
    translations
    as
    const formTranslations: [{
    readonly 'en-US': {
    readonly "@dxos/react-ui-form": {
    readonly "ref-editor.placeholder": "Type '@' to add a reference, or enter a value";
    readonly "ref-editor-auto.placeholder": "Search by name, or enter a value";
    readonly "fields.label": "Fields";
    readonly "hidden-fields.label": "Hidden Fields";
    readonly "empty-readonly-ref-field.label": "(none)";
    readonly "field-property.label": "Property";
    readonly "field-property.placeholder": "Property name";
    readonly "field-format.label": "Type";
    readonly "field-path.label": "Field path";
    readonly "remove-item.button": "Delete item";
    readonly "add-item.button": "Add item";
    readonly "add-property-button.label": "Add property";
    readonly "boolean-input-true.value": "Yes";
    readonly "boolean-input-false.value": "No";
    readonly "indeterminate.placeholder": "Mixed";
    readonly "select-none.label": "None";
    readonly "show-field.label": "Show field";
    readonly "hide-field.label": "Hide field";
    readonly "delete-field.label": "Delete field";
    readonly "create-option.label": "Create";
    readonly "add-tag.label": "Add tag";
    readonly "add-tag-query.label": "Add tag \u201C{{text}}\u201D";
    readonly "ref-field-combobox-input.placeholder": "Search\u2026";
    readonly "ref-field.placeholder": "Select\u2026";
    readonly "ref-field.placeholder_one": "Select\u2026";
    readonly "ref-field.placeholder_other": "Select items\u2026";
    readonly "untitled.label": "Untitled";
    readonly "example.placeholder": "Example";
    readonly "select.placeholder": "Select\u2026";
    readonly "latitude.placeholder": "Latitude (e.g., 40.7128)";
    readonly "longitude.placeholder": "Longitude (e.g., -74.0060)";
    readonly "cancel-button.label": "Cancel";
    readonly "save-button.label": "Save";
    readonly "create-text.label": "Create text";
    readonly "format.boolean.label": "Boolean";
    readonly "format.currency.label": "Currency";
    readonly "format.date.label": "Date";
    readonly "format.date-time.label": "DateTime";
    readonly "format.did.label": "DID";
    readonly "format.duration.label": "Duration";
    readonly "format.dxn.label": "DXN";
    readonly "format.email.label": "Email";
    readonly "format.formula.label": "Formula";
    readonly "format.hostname.label": "Hostname";
    readonly "format.integer.label": "Integer";
    readonly "format.json.label": "JSON";
    readonly "format.lnglat.label": "Geopoint";
    readonly "format.markdown.label": "Markdown";
    readonly "format.password.label": "Password";
    readonly "format.percent.label": "Percent";
    readonly "format.ref.label": "Reference";
    readonly "format.regex.label": "RegExp";
    readonly "format.string.label": "String";
    readonly "format.single-select.label": "Select";
    readonly "format.multi-select.label": "Multi-select";
    readonly "format.text.label": "Long text";
    readonly "format.time.label": "Time";
    readonly "format.timestamp.label": "Timestamp";
    readonly "format.user.label": "User";
    readonly "format.number.label": "Number";
    readonly "format.uri.label": "URI";
    readonly "format.url.label": "URL";
    readonly "format.uuid.label": "UUID";
    readonly "latitude.label": "Latitude";
    readonly "longitude.label": "Longitude";
    readonly "select-option.label": "Label";
    readonly "select-option-label.placeholder": "Option label";
    readonly "select-option-color.label": "Color";
    readonly "select-option-delete.button": "Delete";
    readonly "select-option-add.button": "Add option";
    readonly "system-schema.title": "System type";
    readonly "system-schema.description": "System type: cannot add or remove fields.";
    readonly "remove.button": "Delete";
    };
    };
    }]
    formTranslations
    } from '@dxos/react-ui-form/translations';
    import * as
    import Theme
    Theme
    from '@dxos/react-ui/Theme';
    4 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 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';
    import {
    const ContactsScreen: ({ db }: {
    db: Database;
    }) => React.JSX.Element
    ContactsScreen
    } from './ContactsScreen.tsx';
    import {
    class Organization
    Organization
    ,
    class Person
    Person
    } from './schema.ts';
    17 collapsed lines
    /** Gives the app an identity the first time it runs, and a space to keep the contacts in. */
    const
    const setUp: (client: Client) => Promise<void>

    Gives the app an identity the first time it runs, and a space to keep the contacts in.

    setUp
    = async (
    client: Client
    client
    :
    class Client

    The Client class encapsulates the core client-side API of DXOS.

    Client
    ) => {
    if (!
    client: Client
    client
    .
    Client.halo: Halo

    HALO credentials.

    halo
    .
    Halo.identity: MulticastObservable<Identity | null>
    identity
    .
    MulticastObservable<Identity | null>.get(): Identity | null

    Get the current value of the observable.

    get
    ()) {
    await
    client: Client
    client
    .
    Client.halo: Halo

    HALO credentials.

    halo
    .
    Halo.createIdentity(options?: ProfileDocument, deviceProfile?: DeviceProfileDocument): Promise<Identity>
    createIdentity
    ();
    }
    if (
    client: Client
    client
    .
    Client.spaces: Echo

    ECHO Spaces.

    spaces
    .
    Echo.get(): Space[] (+2 overloads)

    Returns the list of spaces.

    get
    ().
    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
    === 0) {
    await
    client: Client
    client
    .
    Client.spaces: Echo

    ECHO Spaces.

    spaces
    .
    Echo.create(props?: Pick<SpaceProperties, "name" | "hue" | "icon" | "invocationTraceFeed">, options?: CreateSpaceOptions): Promise<Space>

    Creates a new space.

    create
    ({
    name?: string | undefined
    name
    : 'Contacts' });
    }
    };
    /** Shows the screen once the space is there. */
    const
    const Contacts: () => React.JSX.Element | null

    Shows the screen once the space is there.

    Contacts
    = () => {
    const [
    const space: Space
    space
    ] =
    function useSpaces({ all }?: UseSpacesProps): Space[]

    Get all Spaces available to current user. Requires a ClientProvider somewhere in the parent tree. By default, only ready spaces are returned.

    @returns ― an array of Spaces.

    useSpaces
    ();
    return
    const space: Space
    space
    ? <
    const ContactsScreen: ({ db }: {
    db: Database;
    }) => React.JSX.Element
    ContactsScreen
    db: Database
    db
    ={
    const space: Space
    space
    .
    Space.db: EchoDatabase

    Echo database.

    db
    } /> : null;
    };
    /** Keeps the data across reloads and reaches other devices through EDGE, as the ECHO learning path's app does. */
    const
    const config: Config

    Keeps the data across reloads and reaches other devices through EDGE, as the ECHO learning path's app does.

    config
    = new
    new Config(config?: ConfigInit, ...objects: ConfigInit[]): Config

    Creates an immutable instance.

    @constructor

    Config
    ({
    runtime: {
    client: {
    storage: {
    persistent: true;
    };
    edgeFeatures: {
    signaling: true;
    subductionReplicator: true;
    feedReplicator: true;
    };
    };
    services: {
    edge: {
    url: string;
    };
    iceProviders: {
    urls: string;
    }[];
    };
    }
    runtime
    : {
    client: {
    storage: {
    persistent: true;
    };
    edgeFeatures: {
    signaling: true;
    subductionReplicator: true;
    feedReplicator: true;
    };
    }
    client
    : {
    storage: {
    persistent: true;
    }
    storage
    : {
    persistent: true
    persistent
    : true },
    edgeFeatures: {
    signaling: true;
    subductionReplicator: true;
    feedReplicator: true;
    }
    edgeFeatures
    : {
    signaling: true
    signaling
    : true,
    subductionReplicator: true
    subductionReplicator
    : true,
    feedReplicator: true
    feedReplicator
    : true },
    },
    services: {
    edge: {
    url: string;
    };
    iceProviders: {
    urls: string;
    }[];
    }
    services
    : {
    edge: {
    url: string;
    }
    edge
    : {
    url: string
    url
    : 'https://dxos.network/' },
    iceProviders: {
    urls: string;
    }[]
    iceProviders
    : [{
    urls: string
    urls
    : 'https://dxos.network/ice' }],
    },
    },
    });
    /** Runs the database in a worker, in the browser's private file system. */
    const
    const createOpfsWorker: () => Worker

    Runs the database in a worker, in the browser's private file system.

    createOpfsWorker
    = () => new
    var Worker: new (scriptURL: string | URL, options?: WorkerOptions) => Worker

    The Worker interface of the Web Workers API represents a background task that can be created via script, which can send messages back to its creator.

    MDN Reference

    Worker
    (new
    var URL: new (url: string | URL, base?: string | URL) => URL

    The URL interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.

    MDN Reference

    URL class is a global reference for import { URL } from 'url' https://nodejs.org/api/url.html#the-whatwg-url-api

    @since ― v10.0.0

    URL
    ('@dxos/client/opfs-worker', import.

    The type of import.meta.

    If you need to declare that a given property exists on import.meta, this type may be augmented via interface merging.

    meta
    .
    ImportMeta.url: string

    The absolute file: URL of the module.

    url
    ), {
    WorkerOptions.type?: WorkerType | undefined
    type
    : 'module' });
    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
    (
    <
    const ClientProvider: React.ForwardRefExoticComponent<Omit<ClientOptions, "config" | "services"> & Pick<ClientContextProps, "status"> & {
    client?: Client | Provider<Promise<Client>>;
    config?: Config | Provider<Promise<Config>>;
    services?: ClientServicesProvider | ((config?: Config) => MaybePromise<ClientServicesProvider>);
    fallback?: React.FunctionComponent<Partial<ClientContextProps>>;
    suspend?: boolean;
    noBanner?: boolean;
    onInitialized?: (client: Client) => MaybePromise<void>;
    } & {
    ...;
    } & React.RefAttributes<...>>

    Root component that provides the DXOS client instance to child components. To be used with the useClient hook.

    ClientProvider
    config?: Config | Provider<Promise<Config>> | undefined

    Config object or async provider.

    NOTE: If a client is provided then config is ignored.

    config
    ={
    const config: Config

    Keeps the data across reloads and reaches other devices through EDGE, as the ECHO learning path's app does.

    config
    }
    createOpfsWorker?: (() => Worker) | undefined

    When running in the host mode, a factory to create the worker for OPFS sqlite database.

    createOpfsWorker
    ={
    const createOpfsWorker: () => Worker

    Runs the database in a worker, in the browser's private file system.

    createOpfsWorker
    }
    types?: AnyEntity[] | undefined

    ECHO schema.

    types
    ={[
    class Organization
    Organization
    ,
    class Person
    Person
    ]}
    onInitialized?: ((client: Client) => MaybePromise<void>) | undefined

    Post initialization hook to enable to caller to do custom initialization.

    onInitialized
    ={
    const setUp: (client: Client) => Promise<void>

    Gives the app an identity the first time it runs, and a space to keep the contacts in.

    setUp
    }
    >
    <
    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 formTranslations: [{
    readonly 'en-US': {
    readonly "@dxos/react-ui-form": {
    readonly "ref-editor.placeholder": "Type '@' to add a reference, or enter a value";
    readonly "ref-editor-auto.placeholder": "Search by name, or enter a value";
    readonly "fields.label": "Fields";
    readonly "hidden-fields.label": "Hidden Fields";
    readonly "empty-readonly-ref-field.label": "(none)";
    readonly "field-property.label": "Property";
    readonly "field-property.placeholder": "Property name";
    readonly "field-format.label": "Type";
    readonly "field-path.label": "Field path";
    readonly "remove-item.button": "Delete item";
    readonly "add-item.button": "Add item";
    readonly "add-property-button.label": "Add property";
    readonly "boolean-input-true.value": "Yes";
    readonly "boolean-input-false.value": "No";
    readonly "indeterminate.placeholder": "Mixed";
    readonly "select-none.label": "None";
    readonly "show-field.label": "Show field";
    readonly "hide-field.label": "Hide field";
    readonly "delete-field.label": "Delete field";
    readonly "create-option.label": "Create";
    readonly "add-tag.label": "Add tag";
    readonly "add-tag-query.label": "Add tag \u201C{{text}}\u201D";
    readonly "ref-field-combobox-input.placeholder": "Search\u2026";
    readonly "ref-field.placeholder": "Select\u2026";
    readonly "ref-field.placeholder_one": "Select\u2026";
    readonly "ref-field.placeholder_other": "Select items\u2026";
    readonly "untitled.label": "Untitled";
    readonly "example.placeholder": "Example";
    readonly "select.placeholder": "Select\u2026";
    readonly "latitude.placeholder": "Latitude (e.g., 40.7128)";
    readonly "longitude.placeholder": "Longitude (e.g., -74.0060)";
    readonly "cancel-button.label": "Cancel";
    readonly "save-button.label": "Save";
    readonly "create-text.label": "Create text";
    readonly "format.boolean.label": "Boolean";
    readonly "format.currency.label": "Currency";
    readonly "format.date.label": "Date";
    readonly "format.date-time.label": "DateTime";
    readonly "format.did.label": "DID";
    readonly "format.duration.label": "Duration";
    readonly "format.dxn.label": "DXN";
    readonly "format.email.label": "Email";
    readonly "format.formula.label": "Formula";
    readonly "format.hostname.label": "Hostname";
    readonly "format.integer.label": "Integer";
    readonly "format.json.label": "JSON";
    readonly "format.lnglat.label": "Geopoint";
    readonly "format.markdown.label": "Markdown";
    readonly "format.password.label": "Password";
    readonly "format.percent.label": "Percent";
    readonly "format.ref.label": "Reference";
    readonly "format.regex.label": "RegExp";
    readonly "format.string.label": "String";
    readonly "format.single-select.label": "Select";
    readonly "format.multi-select.label": "Multi-select";
    readonly "format.text.label": "Long text";
    readonly "format.time.label": "Time";
    readonly "format.timestamp.label": "Timestamp";
    readonly "format.user.label": "User";
    readonly "format.number.label": "Number";
    readonly "format.uri.label": "URI";
    readonly "format.url.label": "URL";
    readonly "format.uuid.label": "UUID";
    readonly "latitude.label": "Latitude";
    readonly "longitude.label": "Longitude";
    readonly "select-option.label": "Label";
    readonly "select-option-label.placeholder": "Option label";
    readonly "select-option-color.label": "Color";
    readonly "select-option-delete.button": "Delete";
    readonly "select-option-add.button": "Add option";
    readonly "system-schema.title": "System type";
    readonly "system-schema.description": "System type: cannot add or remove fields.";
    readonly "remove.button": "Delete";
    };
    };
    }]
    formTranslations
    , ...
    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 Contacts: () => React.JSX.Element | null

    Shows the screen once the space is there.

    Contacts
    />
    </
    import Theme
    Theme
    .
    const Provider: ({ children, fallback, resourceExtensions, appNs, tx, themeMode, platform, }: Theme.ProviderProps) => React.JSX.Element
    export Provider
    Provider
    >
    </
    const ClientProvider: React.ForwardRefExoticComponent<Omit<ClientOptions, "config" | "services"> & Pick<ClientContextProps, "status"> & {
    client?: Client | Provider<Promise<Client>>;
    config?: Config | Provider<Promise<Config>>;
    services?: ClientServicesProvider | ((config?: Config) => MaybePromise<ClientServicesProvider>);
    fallback?: React.FunctionComponent<Partial<ClientContextProps>>;
    suspend?: boolean;
    noBanner?: boolean;
    onInitialized?: (client: Client) => MaybePromise<void>;
    } & {
    ...;
    } & React.RefAttributes<...>>

    Root component that provides the DXOS client instance to child components. To be used with the useClient hook.

    ClientProvider
    >,
    );

    Then point index.html at src/echo/main.tsx.

Run the app and add a few contacts. Reload, and they are still there.

To see the contacts sync, a second browser profile has to join the space, and this screen has no way to invite one. ECHO’s Sharing a space adds an invitation. With that in place, edits in one window appear in the other.

You can build a screen with TILE whose data lives in ECHO. From here: