
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-tree-selection
Advanced tools
A high-performance and lightweight tree selection library for React Native.

Hierarchical Tree Select Control, a high-performance and lightweight library designed to effortlessly render select components with hierarchical tree data. This versatile control not only facilitates the display of work selection but also empowers users to make their own selection.
It is simple to use and fully customizable. It works on both android and iOS platforms.
| Tree Selection with No Children | Tree Selection with children |
|---|---|
![]() | ![]() |
npm install react-native-tree-selection
yarn add react-native-tree-selection
cd ios && pod install
const treeData: TreeDataTypes[] = [
{
id: '1',
title: 'Fruits',
data: [
{
title: 'Apples',
data: [
{
title: 'Red Delicious',
},
{
title: 'Granny Smith',
},
{
title: 'Gala',
},
],
},
{
title: 'Bananas',
data: [
{
title: 'Cavendish',
},
{
title: 'Lady Finger',
},
],
},
],
},
];
<TreeSelect
data={treeData}
childKey="data"
titleKey="title"
onParentPress={onParentPress}
onChildPress={onChildPress}
onCheckBoxPress={onCheckBoxPress}
/>
Checkout TreeSelect Example here
import React from 'react';
import { TreeDataTypes, TreeSelect } from 'react-native-tree-selection';
const App = () => {
return (
<TreeSelect
data={treeData}
childKey="data"
titleKey="title"
onParentPress={onParentPress}
onChildPress={onChildPress}
onCheckBoxPress={onCheckBoxPress}
/>
);
};
export default App;
| Prop | Default | Type | Description |
|---|---|---|---|
| data | - | Data | An array of objects representing multiple data items organized in a tree structure. Each object can contain various types of data and can be extended to include additional information. This format allows for flexible data manipulation and integration. |
| childKey | data | string | Specifies the name of the property in each node object that contains the children to display. |
| titleKey | title | string | Specifies the name of the property in each node object that contains the title to display. |
| onParentPress | - | function | A callback function that is called when a parent node is clicked. |
| onChildPress | - | function | A callback function that is called when a child node is clicked. |
| onCheckBoxPress | - | function | A callback function that is called when a checkbox is clicked. |
| rightIconStyles | - | ImageStyle | Checkbox image style |
| leftIconStyles | - | ImageStyle | Arrow image style |
| parentContainerStyles | - | ViewStyle | Style for Parent Container |
| childContainerStyles | - | TextStyle | Style for Child Container |
| parentTextStyles | - | TextStyle | Text Styles for Parent |
| childTextStyles | - | TextStyle | Text Styles for Child |
| touchableActiveOpacity | 0.7 | activeOpacity | activeOpacity style for Touchable. |
| flatListProps | - | FlatListProps<ArrayData> | Provide FlatList props. |
| autoSelectParents | true | Boolean | Parents will gets selected when all the children are selected. |
| autoSelectChildren | true | Boolean | Children will gets selected when parent is selected. |
| renderArrowOpen | - | ImagePropType | Change icon for Arrow when parent expands. |
| renderArrowClosed | - | ImagePropType | Change icon for checkbox when checkbox is selected. |
| renderSelect | - | ImagePropType | Change icon for checkbox when checkbox is selected. |
| renderUnSelect | - | ImagePropType | Change icon for checkbox when checkbox is unselected. |
A full working example project is here Example
yarn
yarn example ios // For ios
yarn example android // For Android
Support it by joining stargazers for this repository.⭐
For bugs, feature requests, and discussion please use GitHub Issues, GitHub New Feature, GitHub Feedback
We'd love to have you improve this library or fix a problem 💪 Check out our Contributing Guide for ideas on contributing.
FAQs
A high-performance and lightweight tree selection library for React Native.
We found that react-native-tree-selection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.