Accordion
Subtitle Accordion
Collapsible content panels with main titles and descriptive subtitles. Perfect for React applications requiring detailed section headers with Next.js integration and TypeScript support.
Powered by
Installation
npx shadcn@latest add https://www.shadcn.io/registry/accordion-07.json
npx shadcn@latest add https://www.shadcn.io/registry/accordion-07.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/accordion-07.json
bunx shadcn@latest add https://www.shadcn.io/registry/accordion-07.json
Features
- Title and subtitle layout with flexible content structure for enhanced information hierarchy
- Chevron rotation animation providing clear visual feedback for expand/collapse states
- Vertical text stacking with proper spacing using flexbox column layout
- Optional subtitle rendering with conditional display based on prop availability
- Typography differentiation with distinct font weights for title and subtitle elements
- shadcn/ui integration using consistent design tokens and Tailwind CSS styling
Use Cases
This free open source React component works well for:
- Settings panels - Configuration sections with detailed descriptions built with Next.js
- Help documentation - FAQ sections with summary and explanation text using TypeScript
- Feature descriptions - Product capabilities with headlines and details for React applications
- Account sections - User settings with clear titles and descriptive text using Tailwind CSS
API Reference
Accordion07
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 |
Accordion07Item
Prop | Type | Default | Description |
---|---|---|---|
value | string | required | Unique identifier for this accordion item |
Accordion07Header
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | Content to wrap in accordion header |
Accordion07Trigger
Prop | Type | Default | Description |
---|---|---|---|
title | ReactNode | required | Main title text to display in the trigger |
subtitle | ReactNode | undefined | Optional subtitle text to display below title |
Accordion07Content
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | Content to display when expanded |
Implementation Notes
- Uses flexbox column layout with
space-y-1
for proper title/subtitle spacing - Subtitle rendering is conditional based on prop availability with proper styling
- Chevron icon rotates 180 degrees on expansion with smooth transitions
- Font weight differentiation: semibold for title, normal for subtitle
- Focus ring and keyboard navigation built-in for accessibility compliance
- Compatible with shadcn/ui design system and Tailwind CSS utility classes
Icon Plus Accordion
Collapsible content panels with custom icons and plus/minus indicators. Perfect for React applications requiring feature sections with animated controls and Next.js integration and TypeScript support.
Subtitle Plus Accordion
Collapsible content panels with main titles, descriptive subtitles, and plus/minus indicators. Perfect for React applications requiring detailed section headers with animated controls and Next.js integration and TypeScript support.