https://github.com/detaysoft/react-native-tree-schema
Tree component for React Native apps.
https://github.com/detaysoft/react-native-tree-schema
Last synced: 12 months ago
JSON representation
Tree component for React Native apps.
- Host: GitHub
- URL: https://github.com/detaysoft/react-native-tree-schema
- Owner: Detaysoft
- Created: 2019-06-27T13:46:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T02:16:08.000Z (over 3 years ago)
- Last Synced: 2025-04-15T11:47:32.586Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 5.56 MB
- Stars: 4
- Watchers: 0
- Forks: 3
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-tree-schema
Tree component for React Native apps.

# Install
```javascript
npm install react-native-tree-schema
```
# Architecture

# Components
## Root Component
```javascript
import React from 'react';
import { View } from 'react-native';
import { Icon } from 'react-native-elements';
import { Root } from 'react-native-tree-schema';
class App extends React.Component {
Icon(color= 'red') {
return (
)
}
render() {
return (
{console.log("React is wonderful :) ")},
childNodes: [
{ name: 'Abdurrahman EKER',
icon: this.Icon('#45a5c9'),
},
]
},
{
name: 'Developers',
icon: this.Icon('#f8bc40'),
childNodes: [
{
name: 'Kübra TURAN' ,
icon: this.Icon('#45a5c9'),
},
{
name: 'Reyhan ÜNAL' ,
icon: this.Icon('#45a5c9'),
},
{
name: 'Hamza Kürşat ŞİMŞEK' ,
icon: this.Icon('#45a5c9'),
},
{
name: 'Osman PEKAYDIN' ,
icon: this.Icon('#45a5c9'),
},
{
name: 'Aydın Emre ESEN(Yardımcı Talebe:))' ,
icon: this.Icon('#45a5c9'),
},
]
},
]
}
]}/>
)
}
}
export default App;
```
#### Root props
| prop | default | type | description |
| ---- | ---- | ---- | ---- |
| name | none | string | Node title |
| childNodes | none | array | Node items |
| opened | false | boolean | visible nodes of the noden |
| icon | none | object | icon of node |
| onPress | none | function | Node on press |
| onLongPress | none | function | Node on long press |
### Child Node Item
| prop | default | type | description |
| ---- | ---- | ---- | ---- |
| name | none | string | Node title |
| childNodes | none | array | Node items |
| opened | false | boolean | visible nodes of the noden |
| icon | none | object | icon of node |
| onPress | none | function | Node on press |
| onLongPress | none | function | Node on long press |