Accordion
Usage
function AccordionUsage() {
return (
<View>
<Accordion
title="Hello world"
subtitle="Hello world!"
description="Lorem Ipsum"
/>
</View>
)
}
Custom
function AccordionCustom() {
return (
<View>
<Accordion
title={
<Text status="success" typography="h6">
Hello
</Text>
}
subtitle={
<Text status="error" typography="c2">
Click to know more
</Text>
}
left={<Icon name="home" />}>
<Text status="info">You are certainly not spammed!!</Text>
</Accordion>
</View>
)
}
Props
Prop | Data Type | Default Value | Description |
---|---|---|---|
Extends | -- | Inherits properties from | |
isCollapsed | boolean | -- | Set it to true to open the accordion |
title | ReactNode | -- | Title of the accordion |
subtitle | ReactNode | -- | Title of the accordion |
description | string | -- | Title of the accordion |
children | ReactNode | -- | Render custom view inside the accordion instead of the description only |
left | ReactNode | -- | Render any icon/JSX on left of the title |
right | ReactNode | -- | Render any icon/JSX on right of the title |
containerStyle | StyleProp<ViewStyle> | -- | Container style for the accordion |
onPress | () => void | -- | On press callback on the title section |