@stratakit/structures
Version:
Medium-sized component structures for the Strata design system
23 lines (22 loc) • 1.18 kB
TypeScript
import { Action as TreeItemAction, Root as TreeItemRoot } from "./TreeItem.js";
import type { BaseProps } from "@stratakit/foundations/secret-internals";
interface TreeProps extends BaseProps {
}
/**
* A tree is a hierarchical list of items that can be expanded or collapsed, or optionally selected.
*
* `Tree.Root` is the root component for a tree. `Tree.Item`s are rendered as a flat list in the `Tree.Root` component to create a hierarchical tree structure.
*
* Example:
* ```tsx
* <Tree.Root>
* <Tree.Item label="Parent 1" aria-level={1} aria-posinset={1} aria-setsize={2} />
* <Tree.Item label="Child 1.1" aria-level={2} aria-posinset={1} aria-setsize={2} />
* <Tree.Item label="Child 1.2" aria-level={2} aria-posinset={2} aria-setsize={2} />
* <Tree.Item label="Parent 2" aria-level={1} aria-posinset={2} aria-setsize={2} />
* <Tree.Item label="Child 2.1" aria-level={2} aria-posinset={1} aria-setsize={1} />
* </Tree.Root>
* ```
*/
declare const Tree: import("react").ForwardRefExoticComponent<TreeProps & import("react").RefAttributes<HTMLDivElement | HTMLElement>>;
export { Tree as Root, TreeItemRoot as Item, TreeItemAction as ItemAction };