Skip to main content

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

PropData TypeDefault ValueDescription
Extends--Inherits properties from
isCollapsedboolean--Set it to true to open the accordion
titleReactNode--Title of the accordion
subtitleReactNode--Title of the accordion
descriptionstring--Title of the accordion
childrenReactNode--Render custom view inside the accordion instead of the description only
leftReactNode--Render any icon/JSX on left of the title
rightReactNode--Render any icon/JSX on right of the title
containerStyleStyleProp<ViewStyle>--Container style for the accordion
onPress() => void--On press callback on the title section