1.0.6 • Published 6 years ago
react-simple-treeview v1.0.6
react-simple-treeview
Super minimal treeview react component build with flexibility in mind and 0 external dependencies.
npm i --save react-simple-treeview
Using the component.
import NestedList from 'react-simple-treeview';
const data = [
{
title: 'Unclassified'
},
{
title: 'University',
data: [
{
title: 'Applied Science',
data: []
}
]
},
{
title: 'Plain old me',
data: [
{
title: 'Name',
data: [
{
title: 'Age',
data: [
{
title: 'Job',
data: []
}
]
}
]
}
]
}
];
const listStyle = {
listWrapper: {
display: 'flex',
flexDirection: 'column',
border: '2px solid #e9e9e9',
borderRadius: '4px',
},
listItem: {
padding: '4px',
borderBottom: '2px solid #e9e9e9',
color: 'red'
}
}
<NestedList list={data} leftOffset={5} styles={{...listStyle}} />