React Native · Components
Accordion
Collapsible sections (FAQ, settings groups).
4 exports
Live example
The preview runs in the browser with the web component; the native component takes the same props and looks the same on iOS and Android.
Preview
How long does shipping take?
Orders are delivered within 1-3 business days.
Can I return it?
You can return it for free within 14 days.
Which payment methods are there?
Credit card, debit card and bank transfer.
Code
Events
- Events appear here when you interact with the preview.
Import
Accordion
componentCollapsible sections (FAQ, settings groups). Height is animated; the content of closed sections keeps its state.
Examples
AccordionItem
interfaceA section inside Accordion.
| Name | Type | Description |
|---|---|---|
value? | string | Unique value of the section; defaults to its index. |
title | ReactNode | Text in the header row. |
description? | ReactNode | Small description below the title. |
icon? | IconProp | Icon at the start of the header. |
content | ReactNode | Content shown while the section is open. |
disabled? | boolean | Cannot be opened. |
AccordionVariant
typeLook of the sections: line with dividers between them, card each in its own box.
AccordionProps
interfaceProps of Accordion.
| Name | Type | Default | Description |
|---|---|---|---|
ref? | Ref<ViewRef> | Ref of the underlying native element. | |
items | readonly AccordionItem[] | Sections. | |
exclusive? | boolean | false | Only one section stays open at a time. |
defaultValue? | string | readonly string[] | Value of the initially open section(s). | |
value? | readonly string[] | Open sections (controlled). | |
onValueChange? | (value: string[]) => void | When the open sections change. | |
variant? | AccordionVariant | (string & {}) | "line" | Variant: one of the built-in variants or a name added via appearance.variants.accordion (applied to each section). |
effect? | EffectProp | Effect of the sections ("ripple", "lift"…). Defaults to appearance.defaults.accordion.effect. See BuiltinEffect. | |
style? | StyleProp<ViewStyle> | Container style. |