Accordion
Chevron Accordion
Collapsible content panels with chevron indicators. Perfect for React applications requiring FAQ sections with Next.js integration and TypeScript support.
Powered by
Installation
npx shadcn@latest add https://www.shadcn.io/registry/accordion-01.json
npx shadcn@latest add https://www.shadcn.io/registry/accordion-01.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/accordion-01.json
bunx shadcn@latest add https://www.shadcn.io/registry/accordion-01.json
Features
- Collapsible content sections with smooth expand/collapse animations using Radix UI primitives
- Chevron indicators that rotate to show open/closed state with visual feedback
- Single or multiple panel expansion modes with configurable behavior
- Keyboard navigation with full accessibility support including ARIA attributes
- TypeScript support with complete interface definitions and IntelliSense
- shadcn/ui integration using consistent design tokens and styling patterns
Use Cases
This free open source React component works well for:
- FAQ sections - Common questions and answers built with Next.js and TypeScript
- Documentation interfaces - Organized content sections using Tailwind CSS styling
- Settings panels - Collapsible configuration options for React applications
- Feature comparisons - Expandable product details with shadcn/ui design consistency
API Reference
Accordion01
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 |
Accordion01Item
Prop | Type | Default | Description |
---|---|---|---|
value | string | required | Unique identifier for this accordion item |
Accordion01Trigger
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | Content to display in the trigger button |
Accordion01Content
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | Content to display when expanded |
Implementation Notes
- Uses Radix UI Accordion primitive for robust accessibility features
- Chevron rotation and content animations handled automatically
- Compatible with shadcn/ui design system and Tailwind CSS
- Supports both controlled and uncontrolled usage patterns
- All components accept standard React props and className overrides