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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-outliner-neo

v0.4.0

Published

A React and TypeScript-based outline editor component that supports hierarchical content organization with rich keyboard shortcuts.

Downloads

17

Readme

React Outliner Neo

A React and TypeScript-based outline editor component that supports hierarchical content organization with rich keyboard shortcuts.

Features

  • Rich keyboard shortcuts
    • Enter: Create new sibling item
    • Tab: Indent item (increase level)
    • Shift + Tab: Outdent item (decrease level)
    • Alt + ↑: Move item up
    • Alt + ↓: Move item down
    • ↑/↓: Quick navigation between items
  • Support for expanding/collapsing items
  • Support for deleting items
  • Dark mode support - Built-in CSS variables for seamless theme switching
  • Markdown rendering - Optional markdown support for rich text formatting
  • Drag and drop - Intuitive item reordering with visual feedback
  • Read-only mode - Display-only mode for viewing outlines

Installation

pnpm i react-outliner-neo

Usage

import { Outliner } from "react-outliner-neo";
import { marked } from "marked";

const initialData = [
  {
    topic: "Root Node",
    children: [
      {
        topic: "**Bold text** and *italic text*",
        children: [
          {
            topic: "Child Node 1.1",
          },
        ],
      },
    ],
  },
];

function App() {
  const handleChange = (data) => {
    console.log("Outline data updated:", data);
  };

  // Optional: Enable markdown rendering
  const markdownRenderer = (text: string) => {
    return marked.parseInline(text);
  };

  return (
    <div className="dark"> {/* Add 'dark' class for dark mode */}
      <Outliner 
        data={initialData} 
        onChange={handleChange}
        markdown={markdownRenderer} // Enable markdown rendering
        readonly={false} // Set to true for read-only mode
      />
    </div>
  );
}

API Reference

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | OutlineData[] | Required | Initial outline data | | onChange | (data: OutlineItem[]) => void | Optional | Callback when outline changes | | readonly | boolean | false | Enable read-only mode | | markdown | (text: string) => string | Optional | Markdown renderer function |

Data Structure

interface OutlineData {
  id?: string; // Auto-generated if not provided
  topic: string;
  children?: OutlineData[];
  expanded?: boolean; // Default: true
}

Styling & Theming

Dark Mode

Add the dark class to any parent element to enable dark mode:

<div className="dark">
  <Outliner data={data} />
</div>

Custom Styling

Import the CSS file and customize CSS variables:

import "react-outliner-neo/style.css";
:root {
  --primary-color: #3b35ab;
  --text-color: #1f2937;
  --bg-color: transparent;
  /* ... other variables */
}

.dark {
  --primary-color: #6b9ff3;
  --text-color: #f9fafb;
  /* ... dark mode variables */
}

Tech Stack

  • React 18
  • TypeScript
  • Vite
  • TailwindCSS
  • Lucide React (Icon library)

Development

pnpm dev

Build

pnpm build

Development Requirements

  • Node.js >= 18
  • pnpm >= 8