Tree

Table of Contents

A table of contents that knows where the reader is: the branch down to the current section is open, the section itself is marked by a bar on the rail, and its ancestors are highlighted more faintly.

What you can change

  • the structure through nodes: id, name, href and children on every node
  • the current section through activeId
  • the heading through title and the navigation name through label

A link for your AI agent: preview, code and instructions.

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.
AI
1Pick it here

put this on the home page as the hero:

https://vibeui.ru/c/tree-009?lang=en&theme=dark

2Paste into the chat
3Get it in your project

Not sure where to paste it? Step-by-step guide

Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

Loading…

For developers

The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.

Technical notes

One file, zero dependencies, the --vibeui-tree-009-* palette. A server component: a native details with a computed open holds the disclosure, so the right state arrives from the server, never flickers on hydration, and the browser's own find-in-page reaches hidden entries. The branch opens through the holdsActive walk: every node is asked whether activeId lies inside it. The current entry carries aria-current=page and a bar placed exactly on the rail — the negative offset equals the rail's width, so the line and the mark never drift apart. Ancestors of the current entry get data-onpath and a fainter highlight. The tree is marked up as role=tree with explicit aria-level: a screen reader does not infer depth from nested details.

Tags

  • tree
  • navigation
  • docs
  • sidebar
Component source

The same file your agent installs. Here in case you would rather copy it by hand.

Loading…