Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-matrix-tree

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-matrix-tree

React-matrix-tree allows you to create tree view with different types of matrix.

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
increased by700%
Maintainers
1
Weekly downloads
 
Created
Source

React-Matrix-Tree

React-matrix-tree allows you to create tree view with different types of matrix.

Installation

$ npm install --save react-matrix-tree
$ yarn add react-matrix-tree

import { Tree } from 'react-matrix-tree'
import 'react-matrix-tree/dist/react-matrix-tree.css';

Features

  • Easy to set up for real, you can make it work in less than 1minute!
  • Super easy to customize
  • Can choose matrix type
  • Can display a html content as tooltip
  • Has onClick hooks. Can pass onclick event when user interact
  • Display information using tooltip When user hovers on.
  • You can display dynamic image using imageSource.
  • For Responsive design you have to pass a prop isMobile.
  • And much more !

The gist

One Matrix

import React from 'react'

import { Tree } from 'react-matrix-tree';
import 'react-matrix-tree/dist/react-matrix-tree.css';

function App() {
  const data = [{ title: 'Title' }]

  return (
    <div>
      <Tree color='red' data={data} isMobile={false} />
    </div>
  )
}
One Matrix

Two Matrix

import React from 'react'

import { Tree } from 'react-matrix-tree';
import 'react-matrix-tree/dist/react-matrix-tree.css';

function App() {
  const data = [{ title: 'Title', data: [{ title: 'Title' }, { title: 'Title' }] }]

  return (
    <div>
      <Tree color='red' data={data} isMobile={false} />
    </div>
  )
}
One Matrix

Three Matrix

import React from 'react'

import { Tree } from 'react-matrix-tree';
import 'react-matrix-tree/dist/react-matrix-tree.css';

function App() {
  const data = [{ title: 'Title', data: [{ title: 'Title' }, { title: 'Title' }, { title: 'Title' }] }]

  return (
    <div>
      <Tree color='red' data={data} isMobile={false} />
    </div>
  )
}
Three Matrix

Four Matrix

import React from 'react'

import { Tree } from 'react-matrix-tree';
import 'react-matrix-tree/dist/react-matrix-tree.css';

function App() {
  const data = [
    { title: 'Title', data: [{ title: 'Title' }, { title: 'Title' }, { title: 'Title' }, { title: 'Title' }] },
  ]

  return (
    <div>
      <Tree color='red' data={data} isMobile={false} />
    </div>
  )
}
Four Matrix

The properties

Properties used to customise the rendering:

NameTypeDescription
colorStringArrow color of parent to child
dataArrayused to renders a tree view
isMobileBooleanUsed you to manage responsiveness

data Properties

NameTypeDescription
titleStringTree title
imageSourceStringoptional display's a image
tooltipStringoptional Displays a given content when user hovers on title
onClickfuncoptional Calls the given function when user clicks on title and pass two parameters, first one is click event and second is the object of tree prop
dataArrayoptional Child's array

Demo

A demo is worth a thousand words

Contribute

Show your ❤️ and support by giving a ⭐. Any suggestions are welcome! venkatmcajj@gmail.com

License

Licensed under MIT

Keywords

FAQs

Package last updated on 29 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc