Collapsible
Collapsible shows and hides content with a toggle. Use for FAQs, expandable sections, or progressive disclosure.
Preview
Section titled “Preview”Basic Usage
Section titled “Basic Usage”More Information▼
<Collapsible title="Show Details"> <Text>Hidden content revealed when expanded.</Text></Collapsible>
<Collapsible title="More Information"> <Text>Another section of content.</Text></Collapsible>Default Expanded
Section titled “Default Expanded”<Collapsible title="Interpretation" defaultExpanded> <Text>This hexagram represents the creative principle...</Text></Collapsible>Accordion Group
Section titled “Accordion Group”Only one section can be expanded at a time.
How do I cast a hexagram?▼
What do the lines mean?▼
<CollapsibleGroup accordion> <Collapsible title="What is the I Ching?"> <Text>The I Ching is an ancient Chinese divination text...</Text> </Collapsible> <Collapsible title="How do I cast a hexagram?"> <Text>There are several traditional methods...</Text> </Collapsible> <Collapsible title="What do the lines mean?"> <Text>Each line can be either yin or yang...</Text> </Collapsible></CollapsibleGroup>Custom Header
Section titled “Custom Header”<Collapsible title={ <View style={styles.customHeader}> <Text style={styles.symbol}>☰</Text> <View> <Text style={styles.title}>Hexagram 1 - The Creative</Text> <Text style={styles.subtitle}>Force, Heaven, Strength</Text> </View> </View> }> <Text>The Creative works sublime success...</Text></Collapsible>API Reference
Section titled “API Reference”Collapsible Props
Section titled “Collapsible Props”| Prop | Type | Default | Description |
|---|---|---|---|
title | string | ReactNode | Required | Header content |
children | ReactNode | Required | Collapsible content |
defaultExpanded | boolean | false | Initial expanded state |
expanded | boolean | - | Controlled expanded state |
onExpandedChange | (expanded: boolean) => void | - | Expansion handler |
noAnimation | boolean | false | Disable animation |
style | ViewStyle | - | Container styles |
headerStyle | ViewStyle | - | Header styles |
contentStyle | ViewStyle | - | Content styles |
CollapsibleGroup Props
Section titled “CollapsibleGroup Props”| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Child collapsibles |
accordion | boolean | false | Only one expanded at a time |
style | ViewStyle | - | Custom styles |