react-treemenu-tis
v1.0.8
Published
>
Downloads
2
Readme
react-treemenu-tis
Install
npm i react-treemenu-tis
or
yarn add react-treemenu-tis
Usage
import React from 'react'
import { createPortal } from 'react-dom'
import { TreeMenu } from 'react-treemenu-tis'
import 'react-treemenu-tis/dist/index.css'
const App = () => {
const items = [
{
title: 'Home'
},
{
title: 'Products',
items: [
{
title: 'Product 1'
},
{
title: 'Product 2'
},
{
title: 'Product 3'
}
]
},
{
title: 'Contact us',
items: [
{
title: 'Mail'
},
{
title: 'Phone'
}
]
},
{
title: 'Logout'
}
]
return (
<TreeMenu
titleClassName='TreeMenuTitle'
itemClassName='TreeMenuItem'
title='Tree Menu'
items={items}
onClick={(item) => console.log(`"${item}" selected`)}
createPortal={createPortal}
darkMode={false}
/>
)
}
export default App
Note:
You can add infinity levels of items in TreeMenu.
License
MIT © boof-tech