Current Execution

NESTED CHECKBOX

Next UpCHIPS INPUT

A recursive tree component where parent state depends on children, and children inherit from parents.

View Source Code

Downward Flow

Checking a parent automatically checks all of its descendants recursively.

Upward Flow

If all descendants are checked manually, the parent becomes checked automatically.

Indeterminate Logic

Unchecking any single descendant will automatically uncheck the parent node (or set it to an indeterminate state, which this implementation handles by just unchecking).

Category Selection

Recursive Mode

💡 Engineering Challenges

The complexity lies in the bi-directional state flow:

  • Parent → Child:
    When a parent updates, `updateChildren` recursively forces all descendants to match the new state.
  • Child → Parent:
    The hardest part. `findParent` traverses the tree to locate the ancestor. We then check if every() sibling is checked to update the parent's status recursively upwards.

Flat State Preview

{
  "id": false
}