Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Skeleton examples · List

Hierarchical List Items Skeleton for React

A tree placeholder of icon and label rows, some of them indented as children.

Framework
UI library

A loading tree: rows of a small icon block and a label bar, with child rows indented under their parent. The indent is logical padding, so it follows the writing direction; the blocks are Skeleton elements.

Use it for file trees, nested navigation or a table of contents.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

What does one row contain?

flex items-center gap-3: a size-4 rounded-sm icon and an h-4 flex-1 label. The list is max-w-md with gap-3.

How are the child rows indented?

Child rows add ps-6 on the same flex row. ps-6 is logical padding, so the indent follows the writing direction. Parent rows have no ps-6.

Which rows are children?

Five rows. The first is a parent, the next two are ps-6 children, then another parent, then one ps-6 child. Nothing in the file toggles them.

Why is the icon rounded-sm?

rounded-sm replaces the radius Skeleton gets from your style, so the icon block has its own small radius. The label keeps the default radius.

Why is the label flex-1?

flex-1 lets the h-4 bar fill the row after the size-4 icon. Every row, parent and child, uses that pair.

Should the tree bars be hidden?

Set aria-hidden on each Skeleton when nearby text already says the list is loading. The rows are decorative placeholders.