A vertically stacked set of interactive headings that each reveal a section of content. Uses react-native-reanimated on native and Radix UI Accordion on web.
Installation
Usage
Examples
Default
A basic FAQ-style accordion with collapsible items.
You can place an order by browsing our products, adding items to your cart, and proceeding to checkout. We accept all major credit cards and PayPal.
With Icons
Add icons to accordion triggers for visual context.
Multiple Selection
Allow multiple items to be expanded simultaneously.
Update your name, email, phone number, and profile picture. Your information is securely stored and never shared.
Choose how and when you receive notifications. Customize email, push, and SMS preferences.
Without Borders
Remove the default border styling for a cleaner look.
Rich Content
Accordion content can include any components, not just text.
Custom Indicator
Replace the default chevron with a custom indicator using the indicator prop. Use the useAccordionItem hook to access the expanded state.
You can also pass a static element as the indicator:
No Indicator
Hide the indicator entirely by setting indicator={false}.
API Reference
Accordion
The root container for the accordion.
Accordion.Item
A single accordion item containing a trigger and content.
Accordion.Trigger
The button that toggles the accordion item.
Accordion.Content
The content revealed when the accordion item is expanded.
useAccordionItem
A hook to access the accordion item state. Useful for building custom indicators.
Returns:
isExpanded: boolean- Whether the item is currently expandedtoggle: () => void- Function to toggle the item's expanded statevalue: string- The item's value
Platform Differences
Native (iOS/Android)
- Uses react-native-reanimated for smooth height and opacity animations
- Chevron icon animates rotation using shared values
- Content height is measured on first render for accurate animations
- SF Symbols used for the chevron indicator
Web
- Uses Radix UI Accordion primitives for accessibility
- CSS keyframe animations for expand/collapse
- Built-in keyboard navigation support
data-slotattributes for styling with CSS selectors- Lucide icons used for the chevron indicator
Accessibility
- Trigger buttons have proper ARIA attributes (
aria-expanded,aria-controls) - Keyboard navigation: Enter/Space to toggle, Arrow keys to navigate between items
- Screen reader support through semantic HTML on web
- Focus management handled automatically