React Native Material Group Expandable List Example

04-Apr-2023

.

Admin

React Native Material Group Expandable List Example

Hi Guys,

In this blog, I will explain you how to create material ui group expandable list in react native. You can easily create material ui group expandable list in react native. First i will import stylesheet namespace from react-native-paper, after I will make material ui group expandable list using in react native.

Here, I will give you full example for simply display material ui group expandable list using react native as bellow.

Step 1 - Create project


In the first step Run the following command for create project.

expo init MaterialUIGroupExpandableList

Step 2 - Install Package

In the step,I will install npm i react-native-material-group expandable list package .

npm install --save react-native-material-group expandable list

Step 3 - App.js

In this step, You will open App.js file and put the code.

import * as React from 'react';

import { View, Text } from 'react-native';

import { List } from 'react-native-paper';

const GroupOfListExample = () => (

<List.AccordionGroup>

<List.Accordion title="Accordion 1" id="1">

<List.Item title="Item 1" />

</List.Accordion>

<List.Accordion title="Accordion 2" id="2">

<List.Item title="Item 2" />

</List.Accordion>

<List.Accordion title="Accordion 3" id="3">

<List.Item title="Item 3" />

</List.Accordion>

</List.AccordionGroup>

);

export default GroupOfListExample;

Step 4 - Run project

In the last step run your project using bellow command.

npm start

Output

It will help you...

#React Native