Astryx

Astryx Tree List

Navigation

About

Tree list container. Accepts items data and rendering configuration. Expansion state is managed internally. Astryx by Meta. Source: https://astryx.atmeta.com/components/TreeList

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Tree List to your project and fits it to your theme.

Code

How Astryx Tree List is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

'use client';

/* Copyright (c) 2026 Meta Platforms, Inc. See MIT notice in astryx-tree-list.tsx. */

import '@/components/ui/astryx-tree-list-utils/astryx-preview.css';
import {TreeList} from '@/components/ui/astryx-tree-list';

const noop = () => {};

function TreeListShowcase() {
  return (
    <TreeList
      items={[
        {
          id: 'src',
          label: 'src',
          isExpanded: true,
          children: [
            {
              id: 'components',
              label: 'components',
              children: [
                {id: 'button', label: 'Button.tsx', onClick: noop},
                {id: 'card', label: 'Card.tsx', onClick: noop},
                {id: 'list', label: 'List.tsx', onClick: noop},
              ],
            },
            {id: 'app', label: 'App.tsx', onClick: noop},
            {id: 'index', label: 'index.tsx', onClick: noop},
          ],
        },
        {
          id: 'public',
          label: 'public',
          children: [
            {id: 'favicon', label: 'favicon.ico', onClick: noop},
            {id: 'index-html', label: 'index.html', onClick: noop},
          ],
        },
        {id: 'pkg', label: 'package.json', onClick: noop},
        {id: 'readme', label: 'README.md', onClick: noop},
      ]}
    />
  );
}

export default function Demo() {
  return (
    <div className="astryx-demo" data-astryx-theme="neutral" data-theme="light">
      <div className="astryx-demo-content" style={{maxWidth: 400}}>
        <TreeListShowcase />
      </div>
    </div>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    61
  • Astryx Avatar

    Astryx Avatar

    34
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    32
  • Astryx Badge

    Astryx Badge

    30
  • Astryx Button Group

    Astryx Button Group

    29
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    27
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    10

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    142
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    379
  • Sidebar

    Sidebar

    436
  • Tabs

    Tabs

    18
  • Meniscus — Liquid Bottom Navigation Bar

    Meniscus — Liquid Bottom Navigation Bar

    6
  • Footer Section

    Footer Section

    1
  • Button Breadcrumb

    Button Breadcrumb

    44
  • NavBar

    NavBar

    2