react-treemenu-tis

1.0.8 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i react-treemenu-tis

Weekly Downloads

1

Version

1.0.8

License

MIT

Unpacked Size

277 kB

Total Files

10

Last publish

Collaborators

  • itsmohammadbahrami