interface TreeProps<T> {
    activeKey?: null | Key;
    allowDrop?: AllowDrop<T>;
    autoExpandParent?: boolean;
    blockNode?: boolean;
    checkStrictly?: boolean;
    checkable?: boolean;
    checkedKeys?: Key[] | {
        checked: Key[];
        halfChecked: Key[];
    };
    children?: ReactNode;
    className?: string;
    defaultCheckedKeys?: Key[];
    defaultExpandAll?: boolean;
    defaultExpandParent?: boolean;
    defaultExpandedKeys?: Key[];
    defaultSelectedKeys?: Key[];
    disabled?: boolean;
    draggable?: boolean | DraggableFn | DraggableConfig;
    dropIndicatorRender?: ((props) => ReactNode);
    expandAction?: ExpandAction;
    expandedKeys?: Key[];
    fieldNames?: FieldNames;
    filterAntTreeNode?: ((node) => boolean);
    filterTreeNode?: ((treeNode) => boolean);
    focusable?: boolean;
    height?: number;
    icon?: null | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode | ((nodeProps) => ReactNode) | ((props) => ReactNode);
    itemHeight?: number;
    itemScrollOffset?: number;
    loadData?: ((treeNode) => Promise<any>);
    loadedKeys?: Key[];
    motion?: any;
    multiple?: boolean;
    onActiveChange?: ((key) => void);
    onBlur?: FocusEventHandler<HTMLDivElement>;
    onCheck?: ((checked, info) => void);
    onClick?: NodeMouseEventHandler<T>;
    onContextMenu?: MouseEventHandler<HTMLDivElement>;
    onDoubleClick?: NodeMouseEventHandler<T>;
    onDragEnd?: ((info) => void);
    onDragEnter?: ((info) => void);
    onDragLeave?: ((info) => void);
    onDragOver?: ((info) => void);
    onDragStart?: ((info) => void);
    onDrop?: ((info) => void);
    onExpand?: ((expandedKeys, info) => void);
    onFocus?: FocusEventHandler<HTMLDivElement>;
    onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
    onLoad?: ((loadedKeys, info) => void);
    onMouseEnter?: ((info) => void);
    onMouseLeave?: ((info) => void);
    onRightClick?: ((info) => void);
    onScroll?: UIEventHandler<HTMLElement>;
    onSelect?: ((selectedKeys, info) => void);
    prefixCls?: string;
    rootClassName?: string;
    rootStyle?: CSSProperties;
    selectable?: boolean;
    selectedKeys?: Key[];
    showIcon?: boolean;
    showLine?: boolean | {
        showLeafIcon: TreeLeafIcon;
    };
    style?: CSSProperties;
    switcherIcon?: null | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode | ((props) => ReactNode) | ((props) => ReactNode);
    tabIndex?: number;
    titleRender?: ((node) => ReactNode);
    treeData?: T[];
    virtual?: boolean;
}

Type Parameters

Hierarchy

  • Omit<RcTreeProps<T>, "prefixCls" | "showLine" | "direction" | "draggable" | "icon" | "switcherIcon">
    • TreeProps

Properties

activeKey?: null | Key
allowDrop?: AllowDrop<T>
autoExpandParent?: boolean

Whether to automatically expand the parent node

blockNode?: boolean
checkStrictly?: boolean

Node selection in Checkable state is fully controlled (the selected state of parent and child nodes is no longer associated)

checkable?: boolean

Whether to support selection

checkedKeys?: Key[] | {
    checked: Key[];
    halfChecked: Key[];
}

(Controlled) Tree node with checked checkbox

Type declaration

  • checked: Key[]
  • halfChecked: Key[]
children?: ReactNode
className?: string
defaultCheckedKeys?: Key[]

Tree node with checkbox checked by default

defaultExpandAll?: boolean

Expand all tree nodes by default

defaultExpandParent?: boolean

Expand the corresponding tree node by default

defaultExpandedKeys?: Key[]

Expand the specified tree node by default

defaultSelectedKeys?: Key[]

Tree node selected by default

disabled?: boolean

whether to disable the tree

draggable?: boolean | DraggableFn | DraggableConfig

Set the node to be draggable (IE>8)

dropIndicatorRender?: ((props) => ReactNode)

Type declaration

    • (props): ReactNode
    • Parameters

      • props: {
            direction: Direction;
            dropLevelOffset: number;
            dropPosition: 0 | 1 | -1;
            indent: number;
            prefixCls: string;
        }
        • direction: Direction
        • dropLevelOffset: number
        • dropPosition: 0 | 1 | -1
        • indent: number
        • prefixCls: string

      Returns ReactNode

expandAction?: ExpandAction
expandedKeys?: Key[]

(Controlled) Expand the specified tree node

fieldNames?: FieldNames
filterAntTreeNode?: ((node) => boolean)

Click on the tree node to trigger

Type declaration

    • (node): boolean
    • Click on the tree node to trigger

      Parameters

      • node: AntTreeNode

      Returns boolean

filterTreeNode?: ((treeNode) => boolean)

Type declaration

    • (treeNode): boolean
    • Parameters

      • treeNode: EventDataNode<T>

      Returns boolean

focusable?: boolean
height?: number
icon?: null | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode | ((nodeProps) => ReactNode) | ((props) => ReactNode)

Type declaration

    • (nodeProps): ReactNode
    • Parameters

      • nodeProps: AntdTreeNodeAttribute

      Returns ReactNode

Type declaration

    • (props): ReactNode
    • Parameters

      Returns ReactNode

itemHeight?: number
itemScrollOffset?: number
loadData?: ((treeNode) => Promise<any>)

Type declaration

    • (treeNode): Promise<any>
    • Parameters

      • treeNode: EventDataNode<T>

      Returns Promise<any>

loadedKeys?: Key[]
motion?: any
multiple?: boolean

Whether to support multiple selection

onActiveChange?: ((key) => void)

Used for rc-tree-select only. Do not use in your production code directly since this will be refactor.

Type declaration

    • (key): void
    • Used for rc-tree-select only. Do not use in your production code directly since this will be refactor.

      Parameters

      • key: Key

      Returns void

onBlur?: FocusEventHandler<HTMLDivElement>
onCheck?: ((checked, info) => void)

Type declaration

    • (checked, info): void
    • Parameters

      • checked: Key[] | {
            checked: Key[];
            halfChecked: Key[];
        }
      • info: CheckInfo<T>

      Returns void

onClick?: NodeMouseEventHandler<T>
onContextMenu?: MouseEventHandler<HTMLDivElement>
onDoubleClick?: NodeMouseEventHandler<T>
onDragEnd?: ((info) => void)

Type declaration

    • (info): void
    • Parameters

      • info: NodeDragEventParams<T>

      Returns void

onDragEnter?: ((info) => void)

Type declaration

    • (info): void
    • Parameters

      • info: NodeDragEventParams<T> & {
            expandedKeys: Key[];
        }

      Returns void

onDragLeave?: ((info) => void)

Type declaration

    • (info): void
    • Parameters

      • info: NodeDragEventParams<T>

      Returns void

onDragOver?: ((info) => void)

Type declaration

    • (info): void
    • Parameters

      • info: NodeDragEventParams<T>

      Returns void

onDragStart?: ((info) => void)

Type declaration

    • (info): void
    • Parameters

      • info: NodeDragEventParams<T>

      Returns void

onDrop?: ((info) => void)

Type declaration

    • (info): void
    • Parameters

      • info: NodeDragEventParams<T> & {
            dragNode: EventDataNode<T>;
            dragNodesKeys: Key[];
            dropPosition: number;
            dropToGap: boolean;
        }

      Returns void

onExpand?: ((expandedKeys, info) => void)

Type declaration

    • (expandedKeys, info): void
    • Parameters

      • expandedKeys: Key[]
      • info: {
            expanded: boolean;
            nativeEvent: MouseEvent;
            node: EventDataNode<T>;
        }
        • expanded: boolean
        • nativeEvent: MouseEvent
        • node: EventDataNode<T>

      Returns void

onFocus?: FocusEventHandler<HTMLDivElement>
onKeyDown?: KeyboardEventHandler<HTMLDivElement>
onLoad?: ((loadedKeys, info) => void)

Type declaration

    • (loadedKeys, info): void
    • Parameters

      • loadedKeys: Key[]
      • info: {
            event: "load";
            node: EventDataNode<T>;
        }
        • event: "load"
        • node: EventDataNode<T>

      Returns void

onMouseEnter?: ((info) => void)

Type declaration

    • (info): void
    • Parameters

      • info: NodeMouseEventParams<T>

      Returns void

onMouseLeave?: ((info) => void)

Type declaration

    • (info): void
    • Parameters

      • info: NodeMouseEventParams<T>

      Returns void

onRightClick?: ((info) => void)

Type declaration

    • (info): void
    • Parameters

      Returns void

onScroll?: UIEventHandler<HTMLElement>
onSelect?: ((selectedKeys, info) => void)

Type declaration

    • (selectedKeys, info): void
    • Parameters

      • selectedKeys: Key[]
      • info: {
            event: "select";
            nativeEvent: MouseEvent;
            node: EventDataNode<T>;
            selected: boolean;
            selectedNodes: T[];
        }
        • event: "select"
        • nativeEvent: MouseEvent
        • node: EventDataNode<T>
        • selected: boolean
        • selectedNodes: T[]

      Returns void

prefixCls?: string
rootClassName?: string
rootStyle?: CSSProperties
selectable?: boolean
selectedKeys?: Key[]

(Controlled) Set the selected tree node

showIcon?: boolean
showLine?: boolean | {
    showLeafIcon: TreeLeafIcon;
}

Type declaration

  • showLeafIcon: TreeLeafIcon
style?: CSSProperties
switcherIcon?: null | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode | ((props) => ReactNode) | ((props) => ReactNode)

Type declaration

    • (props): ReactNode
    • Parameters

      Returns ReactNode

Type declaration

    • (props): ReactNode
    • Parameters

      Returns ReactNode

tabIndex?: number
titleRender?: ((node) => ReactNode)

Type declaration

    • (node): ReactNode
    • Parameters

      • node: T

      Returns ReactNode

treeData?: T[]
virtual?: boolean

Generated using TypeDoc