Accordion
Plus Accordion
Collapsible content panels with plus/minus indicators. Perfect for React applications requiring expandable sections with Next.js integration and TypeScript support.
Powered by
Installation
npx shadcn@latest add https://www.shadcn.io/registry/accordion-02.json
npx shadcn@latest add https://www.shadcn.io/registry/accordion-02.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/accordion-02.json
bunx shadcn@latest add https://www.shadcn.io/registry/accordion-02.json
Features
- Plus/minus indicators with smooth rotation animations and visual state transitions
- Custom trigger styling with focus states and accessibility-first design using Radix UI
- Single or multiple panel expansion modes with configurable behavior patterns
- Enhanced animations including icon rotation and opacity effects for visual feedback
- TypeScript support with complete interface definitions and component composition
- shadcn/ui integration using consistent design tokens and Tailwind CSS styling
Use Cases
This free open source React component works well for:
- Help documentation - Step-by-step guides and tutorials built with Next.js and TypeScript
- Product features - Expandable feature descriptions using Tailwind CSS styling
- Settings categories - Organized configuration panels for React applications
- Content sections - Collapsible information blocks with shadcn/ui design consistency
API Reference
Accordion02
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 |
Accordion02Item
Prop | Type | Default | Description |
---|---|---|---|
value | string | required | Unique identifier for this accordion item |
Accordion02Header
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | Content to wrap in accordion header |
Accordion02Trigger
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | Content to display in the trigger button |
Accordion02Content
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | Content to display when expanded |
Implementation Notes
- Uses Radix UI Accordion primitives with custom trigger implementation
- Plus icon automatically transforms to minus when expanded with CSS animations
- Focus ring and keyboard navigation built-in for accessibility compliance
- Compatible with shadcn/ui design system and Tailwind CSS utility classes
- All components support className overrides and standard React props
Chevron Accordion
Collapsible content panels with chevron indicators. Perfect for React applications requiring FAQ sections with Next.js integration and TypeScript support.
Left Chevron Accordion
Collapsible content panels with left-aligned chevron indicators. Perfect for React applications requiring navigation-style accordions with Next.js integration and TypeScript support.