About this set
A file browser table with folders that open and close to show nested files, three levels deep, next to owner, size and modified columns. Rows are flat and in depth-first order, the way most APIs return a tree. Each row sets a –d custom property for its depth, and the name cell’s left padding is 16 pixels plus 22 pixels per level, so indentation needs no extra wrappers. A data-level attribute tells the script each row’s depth. A row is shown only when every folder above it is open, so opening src reveals components and styles, while the contents of a collapsed styles folder stay hidden until it is opened too. Folder names are buttons with aria-expanded and a rotating chevron, and a click anywhere on a folder row does the same. Every name cell also carries visually hidden text such as level 2, so screen reader users hear the depth that sighted users see as indentation. Use it for file managers, category trees, org charts and nested budgets. Folder icons are amber and file icons grey.
What’s included
- Depth from one --d custom property per row
- Folders toggle with buttons that carry aria-expanded
- Nested folders keep their own open or closed state
- Depth also given as hidden text for screen readers
- Works with flat, depth-first row data
Accessibility
The table has a caption and column headers with scope="col". Each folder is a native button with aria-expanded and a 2px focus outline, collapsed rows use the hidden attribute, and each name includes visually hidden level text. Icons are aria-hidden, and the chevron rotation is removed under prefers-reduced-motion.
Customise it
Change the 22px step in the name cell's padding calc for a deeper or shallower indent, and the icon colours in .folder .ic and .file .ic (plain CSS and Bootstrap) or the stroke- utilities on each icon (Tailwind).




















