src / Demo.tsx
1234567891011121314151617181920212223import React, { ReactElement } from "react";
import {
Tree,
useTreeItemSelection,
useTreeItemExpansion,
} from "@react-md/tree";
import folders from "./folders";
export default function Demo(): ReactElement {
const selection = useTreeItemSelection([], true);
const expansion = useTreeItemExpansion([]);
return (
<Tree
id="multi-select-tree"
data={folders}
aria-label="Tree"
{...selection}
{...expansion}
/>
);
}