npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-hierarchical-steps

v2.0.1

Published

A flexible React component for displaying hierarchical data with tree and breadcrumb navigation modes

Downloads

39

Readme

React Hierarchical Steps

A flexible React component library for displaying hierarchical data with multiple navigation modes and customizable styling.

Features

  • Multiple Navigation Modes: Tree view and Breadcrumb navigation
  • Tree Display Modes: Standard tree and Organizational chart layouts
  • Breadcrumb Layouts: Grid and List views
  • Fully Customizable: Custom card rendering, popover forms, and styling
  • TypeScript Support: Full type safety and IntelliSense
  • Responsive Design: Mobile-first approach with CSS modules
  • Theme Support: Light and dark themes
  • Edit & Add Functionality: Built-in CRUD operations with callbacks

Installation

npm install react-hierarchical-steps
# or
yarn add react-hierarchical-steps

Quick Start

import { StepNavigator } from 'react-hierarchical-steps';
import type { StepItem } from 'react-hierarchical-steps';

const data: StepItem[] = [
  {
    title: "WiFi Issues",
    description: "Troubleshoot connectivity problems",
    editable: true,
    enableAddChild: true,
    children: [
      {
        title: "Check Router",
        description: "Verify router status",
        editable: true
      },
      {
        title: "Restart Device", 
        editable: true
      }
    ]
  }
];

function App() {
  const handleEdit = (item, data, path) => {
    console.log('Edit:', item, data, path);
  };

  const handleAdd = (parent, data, path) => {
    console.log('Add:', parent, data, path);
  };

  return (
    <StepNavigator
      data={data}
      mode="breadcrumb" // or "tree"
      enableEdit={true}
      enableAdd={true}
      onEdit={handleEdit}
      onAdd={handleAdd}
      theme="light"
    />
  );
}

Development Setup

1. Clone and Install

git clone <your-repo>
cd react-hierarchical-steps
npm install

2. Run Demo

# Start demo development server
npm run demo

# Build demo
npm run build:demo

The demo will be available at http://localhost:3000

3. Build Library

# Build the library for distribution
npm run build

# Type checking
npm run type-check

4. Project Structure

src/
├── StepNavigator.tsx          # Main component
├── AddEditPopover.tsx         # Popover form component  
├── TreeNodeStandard.tsx       # Standard tree display
├── TreeNodeOrganizational.tsx # Org chart display
├── BreadcrumbNavigation.tsx   # Breadcrumb navigation
├── StepNavigator.module.css   # CSS modules styling
├── types.ts                   # TypeScript definitions
├── index.ts                   # Library exports
├── Demo.tsx                   # Demo component
├── main.tsx                   # Demo entry point
└── index.html                 # Demo HTML

Props Reference

StepNavigatorProps

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | StepItem[] | Required | Hierarchical data array | | mode | 'tree' \| 'breadcrumb' | 'breadcrumb' | Navigation mode | | treeDisplayMode | 'standard' \| 'organizational' | 'standard' | Tree layout style | | breadcrumbDisplayMode | 'grid' \| 'list' | 'grid' | Breadcrumb layout | | showConnectingLines | boolean | true | Show tree connecting lines | | enableEdit | boolean | false | Enable edit functionality | | enableAdd | boolean | false | Enable add functionality | | onEdit | Function | - | Edit callback | | onAdd | Function | - | Add callback | | customCardRenderer | Function | - | Custom card component | | customPopoverComponent | Function | - | Custom popover form | | theme | 'light' \| 'dark' | 'light' | Color theme |

StepItem

| Property | Type | Description | |----------|------|-------------| | id? | string | Unique identifier | | title | string | Display title | | description? | string | Optional description | | comment? | string | Optional comment | | children? | StepItem[] | Nested items | | editable? | boolean | Allow editing | | enableAddChild? | boolean | Allow adding children | | metadata? | Record<string, any> | Custom data |

Navigation Modes

Tree Mode

  • Standard: Traditional hierarchical tree with connecting lines
  • Organizational: Horizontal org-chart layout like decision trees

Breadcrumb Mode

  • Grid: Responsive card grid layout
  • List: Vertical stacked list layout

Customization

Custom Card Rendering

const customCardRenderer = (item: StepItem, defaultCard: React.ReactNode) => (
  <div style={{ border: '2px solid red' }}>
    {defaultCard}
    <div>Custom content for {item.title}</div>
  </div>
);

<StepNavigator 
  data={data}
  customCardRenderer={customCardRenderer}
/>

Custom Popover Form

const CustomForm = ({ data, onChange, onSubmit, onCancel }) => (
  <div>
    <input
      value={data.title}
      onChange={(e) => onChange({ ...data, title: e.target.value })}
    />
    <button onClick={onSubmit}>Save</button>
    <button onClick={onCancel}>Cancel</button>
  </div>
);

<StepNavigator 
  data={data}
  customPopoverComponent={CustomForm}
/>

Styling

The component uses CSS modules to avoid style conflicts. You can:

  1. Override CSS variables for theming
  2. Add custom classes via className and cardClassName props
  3. Use custom renderers for complete control

License

MIT