Multi-level Accordion
Collapsible content panels with nested collapsible sections and table-style borders. Perfect for React applications requiring hierarchical content organization with seamless row connections and Next.js integration and TypeScript support.
Powered by
Installation
npx shadcn@latest add https://www.shadcn.io/registry/accordion-19.json
npx shadcn@latest add https://www.shadcn.io/registry/accordion-19.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/accordion-19.json
bunx shadcn@latest add https://www.shadcn.io/registry/accordion-19.json
Features
- Multi-level nested design combining accordion and collapsible components for hierarchical content
- Table-style connected borders with negative spacing creating seamless row appearance
- Enhanced focus management with z-index layering and ring visibility controls in nested structure
- Accent background sections for visual hierarchy differentiation between primary and secondary content
- Chevron rotation animations with smooth transitions for both accordion and collapsible states
- shadcn/ui integration using consistent design tokens and Tailwind CSS styling
Use Cases
This free open source React component works well for:
- FAQ hierarchies - Main questions with sub-questions and detailed explanations built with Next.js
- Documentation structures - Nested help sections with categorized information using TypeScript
- Settings panels - Multi-level configuration options with grouped sub-settings for React applications
- Menu structures - Category-based navigation with sub-menu organization using Tailwind CSS
API Reference
Accordion19
Prop | Type | Default | Description |
---|---|---|---|
type | 'single' | 'multiple' | required | Whether single or multiple items can be expanded |
collapsible | boolean | false | Whether expanded items can be collapsed |
defaultValue | string | string[] | undefined | Default expanded item(s) |
value | string | string[] | undefined | Controlled expanded item(s) |
onValueChange | (value: string | string[]) => void | undefined | Callback when expanded items change |
Accordion19Item
Prop | Type | Default | Description |
---|---|---|---|
value | string | required | Unique identifier for this accordion item |
Accordion19Trigger
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | Content to display in the trigger button |
Accordion19Content
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | Content to display when expanded |
Accordion19Collapsible
Prop | Type | Default | Description |
---|---|---|---|
title | string | required | Title text for the collapsible header |
content | string | required | Content text to display when expanded |
open | boolean | false | Whether the collapsible starts open |
Implementation Notes
- Combines accordion and collapsible components for true multi-level hierarchical content
- Uses
-space-y-px
for negative spacing creating seamless table-like row connections - Accent background (
bg-accent
) provides visual differentiation for nested collapsible sections - Custom animations with
data-[state=closed]:animate-collapsible-up
anddata-[state=open]:animate-collapsible-down
- Zero padding on accordion content (
p-0
) allows collapsible sections to extend to edges - Compatible with shadcn/ui design system and Tailwind CSS utility classes
Table Left Plus Accordion
Collapsible content panels with table-style borders and left-aligned plus/minus indicators. Perfect for React applications requiring tabular navigation with animated controls and Next.js integration and TypeScript support.
Multi-level Icon Accordion
Collapsible content panels with nested collapsible sections and icon support at all levels. Perfect for React applications requiring hierarchical content organization with visual indicators and Next.js integration and TypeScript support.