# Accordion Nested Tree — React Accordion Component

> A nested tree with indent guides where branches unfold with animated height and staggered children, fully navigable with the arrow keys.

- Category: [Accordions](https://pixelpapa.com/components/accordions.md)
- Tags: accordion, tree, nested, navigation, keyboard
- Dependencies: lucide-react, motion (plus React and Tailwind CSS v4)
- Last updated: 2026-11-13
- Live preview: https://pixelpapa.com/components/accordions/accordion-nested-tree

## Install (PixelPapa Pro)

This is a Pro component. With a Pro or Scale plan and the `@pixelpapa` registry set up (https://pixelpapa.com/docs/installation#pro):

```bash
npx shadcn@latest add @pixelpapa/accordion-nested-tree
```

The file is written to `components/pixelpapa/accordion-nested-tree.tsx`. Source code is available to Pro members on https://pixelpapa.com/components/accordions/accordion-nested-tree.

## AI prompt

```text
Add the "Accordion Nested Tree" component from PixelPapa UI to this project.

What it is: A nested tree with indent guides where branches unfold with animated height and staggered children, fully navigable with the arrow keys.
Category: Accordions. Depends on: lucide-react, motion.

1. Install it with the shadcn CLI. It is a PixelPapa Pro component, so components.json needs the "@pixelpapa" registry with my API key (https://pixelpapa.com/docs/installation#pro):
   npx shadcn@latest add @pixelpapa/accordion-nested-tree
   (If the CLI is unavailable, fetch https://pixelpapa.com/r/accordion-nested-tree.json with the header "Authorization: Bearer $PIXELPAPA_API_KEY", write files[0].content to components/pixelpapa/accordion-nested-tree.tsx and install the listed dependencies.)
2. Import it from "@/components/pixelpapa/accordion-nested-tree" and place it where I describe below.
3. Keep its animation timings and accessibility attributes. Replace the demo copy and data with content that fits my product, and use my existing theme tokens (bg-background, text-foreground, bg-primary, border-border) rather than hard-coded colours.

Where to use it: <describe the page and position here>
```

## More accordions

- [Accordion Horizontal Panels](https://pixelpapa.com/components/accordions/accordion-horizontal-panels.md) (Pro): Side-by-side panels where the chosen one springs wide to reveal its story while the others fold down to a vertical title.
- [Accordion Numbered Editorial](https://pixelpapa.com/components/accordions/accordion-numbered-editorial.md): A magazine-style accordion with oversized serif numerals, a rule that draws across the open row and a plus that folds into a minus.
- [Accordion Smooth Height](https://pixelpapa.com/components/accordions/accordion-smooth-height.md): A single-open accordion that animates to its content's natural height while the chevron turns and the answer settles in from a blur.
- [Accordion With Icons Cards](https://pixelpapa.com/components/accordions/accordion-with-icons-cards.md): Separate accordion cards with icon tiles; the open card lifts on a spring, its icon fills with colour and the plus turns into a close mark.
