@dxos/react-ui-list
    Preparing search index...

    Type Alias TreeRootProps<T>

    type TreeRootProps<T extends { id: string } = any> = {
        animate?: boolean;
        canDrop?: TreeContextValue["canDrop"];
        canSelect?: (params: { item: T; path: string[] }) => boolean;
        children?: ReactNode;
        columns?: string;
        draggable?: boolean;
        dragPreview?: boolean | ((item: T) => ReactNode);
        dropAtEnd?: boolean;
        dropBelowExpanded?: boolean;
        getDropKind?: TreeContextValue["getDropKind"];
        hideDragSource?: boolean;
        id: string;
        indentGuides?: boolean;
        leavesAcceptChildren?: boolean;
        model: TreeModel<T>;
        multiline?: boolean;
        onDrop?: (event: TreeDropEvent<T>) => void;
        onItemHover?: (params: { item: T }) => void;
        onKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void;
        onOpenChange?: (params: { item: T; open: boolean; path: string[] }) => void;
        onSelect?: (event: TreeSelectEvent<T>) => void;
        path?: string[];
        ref?: Ref<TreeRootHandle>;
        rootId?: string;
        selectionFollowsFocus?: boolean;
        selectionMode?: "single" | "multiple";
        size?: Util.Size;
        virtual?: TreeVirtual;
    }

    Type Parameters

    • T extends { id: string } = any
    Index

    Properties

    animate?: boolean

    Animate user-driven disclosure (never the initial or persisted open state); off under reduced motion.

    canDrop?: TreeContextValue["canDrop"]
    canSelect?: (params: { item: T; path: string[] }) => boolean

    Whether a row can be selected; activating a branch that cannot be toggles it instead.

    children?: ReactNode
    columns?: string

    Each row's grid template; the default is disclosure, icon, label and trailing tracks. A template that keeps Tree.ItemIndicator starts with its var(--dx-half-block-size) track.

    draggable?: boolean
    dragPreview?: boolean | ((item: T) => ReactNode)

    The native drag preview: by default a DragPreview chip with the row's icon and label; a renderer fills the chip instead; false keeps the browser's snapshot of the row.

    dropAtEnd?: boolean

    Render a strip after the last row that accepts a drop meaning "append at the end".

    dropBelowExpanded?: boolean

    Give an open branch a reorder-below zone meaning "after this row and its subtree", in place of reparent bands.

    getDropKind?: TreeContextValue["getDropKind"]
    hideDragSource?: boolean

    Take the dragged row out of the list for the drag, rather than fading it in place.

    id: string

    Prefix of every row's path, and the drag scope: trees sharing it accept each other's rows.

    indentGuides?: boolean
    leavesAcceptChildren?: boolean

    Whether a childless row offers a make-child zone; off where leaves are terminal (a navtree's documents).

    model: TreeModel<T>
    multiline?: boolean

    Let a row grow past one block for cells placed on further grid lines (a description under the label): the first line stays one block and later lines size to their content. A fixed window assumes one block per row, so pair it with virtual='measured', 'variable' or none.

    onDrop?: (event: TreeDropEvent<T>) => void
    onItemHover?: (params: { item: T }) => void

    Pointer or drag entering a row, e.g. to prefetch its children before a hold opens it.

    onKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void

    Keydown on the tree element, before the machine's. A key the consumer takes (preventDefault) on a row returns focus to that row once the tree re-renders, found by id, since a restructuring key remounts it under a new path.

    onOpenChange?: (params: { item: T; open: boolean; path: string[] }) => void
    onSelect?: (event: TreeSelectEvent<T>) => void

    A row activation (click, Enter, or the machine's selection). Option-click on a branch toggles it instead, and a click on the current row reports it again (the machine emits nothing for it).

    path?: string[]

    Ancestors the rows' paths start from, ahead of id (e.g. a navtree workspace's own path); its first id is then the drag scope, so trees mounted under one root (a tree per workspace tab) accept each other's rows.

    ref?: Ref<TreeRootHandle>
    rootId?: string

    The model node whose children are the top rows; undefined asks the model for its root.

    selectionFollowsFocus?: boolean

    Move selection with the roving tabstop, for a list whose selection only highlights a row.

    selectionMode?: "single" | "multiple"
    size?: Util.Size
    virtual?: TreeVirtual

    fixed windows the rows (each one block tall); measured windows rows of any height, measuring each as it mounts; variable mounts every row and skips painting those out of view.