Skip to content

shadcn.io is an independent project built on shadcn/ui

Hierarchical List Items Skeleton for Ark UI

A tree placeholder of icon and label rows, with child rows indented under their parent rows.

Rows of a small icon and a label form a tree. Child rows are indented, and the indent follows the writing direction.

Use it for a file tree or a table of contents while the nodes load. The control those bars stand in for is a Tree View. In React, Ark UI does not expand a node.

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.
Use email insteadNo credit card

Anatomy

Skeleton anatomy: avatar, title, description, media

Usage

<div className="flex w-full max-w-md flex-col gap-3">
  <div className="flex items-center gap-3">
    <Skeleton className="size-4 rounded-sm" />
    <Skeleton className="h-4 flex-1" />
  </div>
  <div className="flex items-center gap-3 ps-6">
    <Skeleton className="size-4 rounded-sm" />
    <Skeleton className="h-4 flex-1" />
  </div>
  <div className="flex items-center gap-3 ps-6">
    <Skeleton className="size-4 rounded-sm" />
    <Skeleton className="h-4 flex-1" />
  </div>
  <div className="flex items-center gap-3">
    <Skeleton className="size-4 rounded-sm" />
    <Skeleton className="h-4 flex-1" />
  </div>
  <div className="flex items-center gap-3 ps-6">
    <Skeleton className="size-4 rounded-sm" />
    <Skeleton className="h-4 flex-1" />
  </div>
</div>

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.

API Reference

Skeleton

No extra props in this demo. The rest is on the Skeleton page.