0.1.4 • Published 6 months ago

react-hierarchy-visualizer v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

React Hierarchy Visualizer

A beautiful and interactive React component hierarchy visualization tool. This package provides a tree visualization of your React component hierarchy with detailed props information and file navigation capabilities.

Features

  • 🌳 Interactive tree visualization of React component hierarchy
  • 📊 Detailed view of consumed and passed props
  • 📁 Direct file navigation capabilities
  • 🎨 Beautiful, dark-themed UI
  • 🔍 Expandable/collapsible prop information
  • 🖱️ Zoom and pan capabilities

Installation

npm install @cursor/react-hierarchy-visualizer
# or
yarn add @cursor/react-hierarchy-visualizer

Usage

import { ComponentHierarchy } from '@cursor/react-hierarchy-visualizer';

function App() {
  return (
    <ComponentHierarchy
      rootComponent={
        <YourRootComponent>
          {/* Your component tree */}
        </YourRootComponent>
      }
    />
  );
}

Props

PropTypeDescription
rootComponentReactElementThe root React component whose hierarchy you want to visualize

Example

import { ComponentHierarchy } from '@cursor/react-hierarchy-visualizer';

function App() {
  return (
    <ComponentHierarchy
      rootComponent={
        <div>
          <Header>
            <Navigation items={['Home', 'About', 'Contact']} />
            <SearchBar onSearch={(query) => console.log(query)} />
          </Header>
          <MainContent>
            <Sidebar />
            <ArticleList articles={articles} />
          </MainContent>
          <Footer />
        </div>
      }
    />
  );
}

Features

Component Information

  • Component name
  • File path
  • Props visualization
  • Interactive navigation

Visualization

  • Zoomable and draggable interface
  • Vertical tree layout
  • Smooth animations
  • Dark theme for better readability

Props Display

  • Consumed props with values
  • Passed props to children
  • Expandable/collapsible sections
  • Type indicators

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © Cursor

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago