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

svelte-outliner

v0.0.1

Published

A Svelte 5 outline editor with keyboard shortcuts, drag-and-drop, zoom, undo/redo, and optional markdown rendering

Readme

svelte-outliner

A Svelte outline editor component with hierarchical content organization, keyboard shortcuts, drag-and-drop, zoom navigation, undo/redo, and optional markdown rendering.

Ported from solid-outliner (itself from react-outliner) with the same interaction model.

Features

  • Keyboard shortcuts
    • Enter: Create new sibling (or split at cursor)
    • Shift + Enter: Create sibling before current item
    • Tab / Shift + Tab: Indent / outdent
    • Alt + ↑/↓: Move item up / down
    • ↑/↓: Navigate between items
    • Backspace on empty non-root item: Delete
    • Ctrl/Cmd + Z / Ctrl/Cmd + Shift + Z / Ctrl + Y: Undo / redo
  • Expand / collapse
  • Drag and drop reordering (before / inside / after)
  • Zoom into a node with breadcrumb navigation
  • Read-only mode
  • Optional markdown renderer
  • Dark mode via CSS variables (.dark class)

Install

pnpm add svelte-outliner
# peer: svelte ^5

Usage

<script lang="ts">
	import { Outliner, type OutlineItem } from 'svelte-outliner';
	// Styles are imported by the component. If they are missing in your setup:
	// import 'svelte-outliner/OutlineItem.css';

	let data = $state<OutlineItem[]>([
		{
			id: '1',
			topic: 'Root Node',
			children: [
				{
					id: '1-1',
					topic: '**Bold text** and *italic text*',
					children: []
				}
			]
		}
	]);
</script>

<div class="dark">
	<Outliner
		data={data}
		onChange={(next) => (data = next)}
		markdown={(text) => text}
		readonly={false}
		fileName="My Outline"
	/>
</div>

Local development (this repo)

The demo site imports from $lib instead of the package name:

import { Outliner } from '$lib';
import '$lib/outliner/OutlineItem.css';

API

Props

| Prop | Type | Default | Description | | ---------- | --------------------------------------------- | ---------------- | ---------------------------- | | data | OutlineData[] | required | Initial outline data | | onChange | (data: OutlineItem[]) => void | optional | Fired when outline changes | | readonly | boolean | false | Read-only mode | | markdown | (text: string, item: OutlineItem) => string | optional | Markdown/HTML renderer | | fileName | string | optional | Shown in breadcrumb root | | i18n | Partial<OutlinerI18n> | Chinese defaults | Menu / UI strings |

Data structure

interface OutlineData {
	id: string;
	topic: string;
	children?: OutlineData[];
	expanded?: boolean; // default: true
}

This is the same node shape as Mind Elixir / mindmapcn-svelte (id, topic, children, expanded). A mind-map root maps to outliner as fileName={root.topic} + data={root.children}. Demo: /mindmap.

Other exports

import {
	Outliner,
	createHistory,
	addSiblingOperation,
	addSiblingBeforeOperation,
	indentOperation,
	outdentOperation,
	moveUpOperation,
	moveDownOperation,
	moveToOperation,
	type OutlineItem,
	type OutlineData,
	type OutlinerProps,
	type OutlinerI18n,
	type HistoryManager
} from 'svelte-outliner';

Development

pnpm install
pnpm dev       # demo site (src/routes)
pnpm build     # build demo site only
pnpm package   # build library to dist/ (for npm)
pnpm check     # typecheck

| Command | Output | | --------------- | ------------------------------ | | pnpm build | Demo / docs site | | pnpm package | npm library (dist/) |

Library source lives in src/lib/outliner. The demo site and mindmap live under src/routes / other $lib folders and are not published to npm.

Publish

See docs/PUBLISH.md for the full checklist (version bump, npm publish, site deploy).

Tech stack

  • Svelte 5 (runes)
  • SvelteKit (demo app + @sveltejs/package for the library)
  • TypeScript
  • Vite

License

MIT