1.0.8 • Published 2 years ago

react-treemenu-tis v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-treemenu-tis

NPM JavaScript Style Guide

react-treemenu-tis Banner

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

1.0.8

2 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago