List Accordion
A component designed to display a list item that can expand and collapse.
- Basic
- With Subtitle
- With Left Icon
Usage
import React, {type ReactElement} from 'react';
import 'react-native-gesture-handler';
import {List} from './components';
export const Example = (): ReactElement => {
return (
<List>
<List.Accordion
left={() => <List.Icon icon="account-circle" color="primary" />}
title="Expandable List Item"
subTitle="Accordion subtitle here">
<List.Item
title="list item1"
description="list item description here"
left={() => <List.Icon icon="heart" color="primary" />}
right={() => <List.Icon icon="alert-circle" color="primary" />}
/>
</List.Accordion>
</List>
);
};
export default Example;
Props
title(required)
Type: 'string'
Title text for the list accordion.
subtitle
Type: 'string'
Subtitle text for the list accordion.
left
Type: '() => React.ReactNode'
children
Type: 'React.ReactNode'
Content of the accordion.