# TreeComponent

An expandable tree of rows.

```java
TreeComponent<File> files = add(new TreeComponent<>(at(new Box("files", 8, 8, 180, 120)),
        List.of(root), File::kids, File::name)
        .icon(f -> f.isDirectory() ? Icon.FOLDER : null)
        .onSelect(this::preview)
        .onActivate(this::open));
files.expand(root);
files.setRoots(List.of(newRoot)); // nodes that are equal stay open
```

## Variants

- Rows

Page: https://minuit.dryaides.com/components/tree.html
