Skip to contentWolf-Rayet

Table tree

A table tree is a table that expands to show nested levels of information.

Install

One package and one stylesheet. The stylesheet holds the tokens every component uses.

pnpm add @wolf-rayet/react
import '@wolf-rayet/react/css/wolf-rayet.css';
import { TableTree } from '@wolf-rayet/react';

Props

A required prop is marked with an asterisk.

PropTypeDefaultDescription
rows *readonly TreeRow[]NoneThe top level rows. Each row can have children, nested to any depth.
label *stringNoneNames the tree for assistive technology. Say what the hierarchy is.

Accessibility

What the component does for you, and what it needs from you.

  • The label names the tree. Each row reports whether it is expanded, so screen readers announce the state.
  • Depth is in the markup, so screen reader users know which level they are on without seeing the indentation.
  • A row with no children should not offer a control that does nothing.