Join our Discord community
Accordion

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.

Powered by

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/accordion-20.json
npx shadcn@latest add https://www.shadcn.io/registry/accordion-20.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/accordion-20.json
bunx shadcn@latest add https://www.shadcn.io/registry/accordion-20.json

Features

  • Multi-level icon design combining accordion and collapsible components with icon support at all hierarchy levels
  • Visual branding enhancement with customizable Lucide React icons for both primary and secondary content sections
  • Enhanced focus management with ring visibility controls optimized for icon-rich nested structure
  • Flexible icon positioning with proper spacing and opacity for visual hierarchy differentiation
  • 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:

  • Feature showcases - Product capabilities with branded icons and detailed sub-features built with Next.js
  • Service portfolios - Business offerings with visual indicators and nested service details using TypeScript
  • Navigation menus - Multi-level menu structures with icon-based categorization for React applications
  • Dashboard sections - Administrative panels with icon-coded sections and sub-options using Tailwind CSS

API Reference

Accordion20

PropTypeDefaultDescription
type'single' | 'multiple'requiredWhether single or multiple items can be expanded
collapsiblebooleanfalseWhether expanded items can be collapsed
defaultValuestring | string[]undefinedDefault expanded item(s)
valuestring | string[]undefinedControlled expanded item(s)
onValueChange(value: string | string[]) => voidundefinedCallback when expanded items change

Accordion20Item

PropTypeDefaultDescription
valuestringrequiredUnique identifier for this accordion item

Accordion20Trigger

PropTypeDefaultDescription
childrenReactNoderequiredContent to display in the trigger button
iconLucideIconundefinedOptional Lucide React icon to display with title

Accordion20Content

PropTypeDefaultDescription
childrenReactNoderequiredContent to display when expanded

Accordion20Collapsible

PropTypeDefaultDescription
titlestringrequiredTitle text for the collapsible header
contentstringrequiredContent text to display when expanded
openbooleanfalseWhether the collapsible starts open
iconLucideIconrequiredLucide React icon to display with title

Implementation Notes

  • Combines accordion and collapsible components with comprehensive icon support for visual hierarchy
  • Icons positioned with proper spacing using flexbox layout and gap-3 for consistent alignment
  • Optional icon rendering with conditional display based on prop availability for accordion triggers
  • Required icon support for collapsible sections ensuring visual consistency at secondary level
  • 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