@devtools-ds/tree
Version:
A versatile expanding `Tree` component, with full keyboard navigation following the [Tree View Design Pattern](https://www.w3.org/TR/wai-aria-practices/examples/treeview/treeview-2/treeview-2a.html).
19 lines (15 loc) • 373 B
text/typescript
import React from 'react';
interface TreeContext {
/** Whether the current tree is a child of another */
isChild: boolean;
/** Depth of current node */
depth: number;
/** Whether to have hover styles */
hasHover: boolean;
}
const TreeContext = React.createContext<TreeContext>({
isChild: false,
depth: 0,
hasHover: true
});
export default TreeContext;