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

codepane

v0.1.1

Published

Composable, performance-first file explorer & code editor for React

Readme

codepane

Composable, performance-first file explorer & code editor for React.

Live demo →

npm version CI License: MIT Bundle size

Features

  • 13 composable compound components (Editor.Root, Editor.FileTree, Editor.Tabs, and more)
  • 9 headless hooks for building fully custom UIs
  • Pluggable filesystem adapters (HTTP, in-memory, custom)
  • CodeMirror 6 with 15+ language grammars (lazy-loaded)
  • Virtualized file tree that handles 10,000+ files
  • CSS custom properties theme system with Zed-inspired presets
  • Built-in diff viewer (unified + split)
  • Command palette, minimap, and context menus
  • Zero Tailwind dependency -- inline styles + CSS vars only
  • TypeScript-first with 40+ exported types

Install

bun add codepane
# or
npm install codepane

Quick Start

import { Editor, createMemoryAdapter } from 'codepane'

const adapter = createMemoryAdapter({
  files: {
    'src/index.ts': 'console.log("hello")',
    'src/utils.ts': 'export const add = (a: number, b: number) => a + b',
    'package.json': '{ "name": "my-project" }',
  },
})

function App() {
  return (
    <Editor.Root adapter={adapter}>
      <Editor.PanelGroup direction="horizontal">
        <Editor.Panel defaultSize={25}>
          <Editor.FileTree />
        </Editor.Panel>
        <Editor.PanelResizeHandle />
        <Editor.Panel defaultSize={75}>
          <Editor.Tabs />
          <Editor.Content />
          <Editor.StatusBar />
        </Editor.Panel>
      </Editor.PanelGroup>
    </Editor.Root>
  )
}

Headless Usage

If you need full control over the UI, use the hooks directly:

import { useEditor, useFileTree, useTabs } from 'codepane'

function CustomEditor() {
  const { adapter } = useEditor()
  const { tree, expandDir, collapseDir } = useFileTree()
  const { tabs, activeTabId, openFile, closeTab } = useTabs()
  // Build your own UI with full control
}

All 9 hooks (useEditor, useFileTree, useTabs, useSearch, useTheme, useKeybindings, useConfig, useContextMenu, useCommandPalette) are available for headless usage.

Adapters

codepane uses filesystem adapters to read and write files. Two built-in adapters are included.

In-Memory Adapter

Pass a plain object of file paths and contents. Useful for demos, playgrounds, and tests.

import { createMemoryAdapter } from 'codepane'

const adapter = createMemoryAdapter({
  files: {
    'README.md': '# Hello',
    'src/index.ts': 'export default {}',
  },
})

HTTP Adapter

Fetch files from a remote server. Provide a base URL and codepane handles the rest.

import { createHttpAdapter } from 'codepane'

const adapter = createHttpAdapter({
  baseUrl: 'https://api.example.com/repos/my-repo',
  headers: { Authorization: 'Bearer token' },
})

You can also implement a custom adapter by conforming to the FilesystemAdapter interface.

Theming

codepane ships with a CSS custom properties theme system and Zed-inspired presets.

import { Editor, defaultDarkTheme, defaultLightTheme, mergeTheme } from 'codepane'

// Use a built-in theme
<Editor.Root theme={defaultDarkTheme}>
  {/* ... */}
</Editor.Root>

// Extend a theme with custom overrides
const customTheme = mergeTheme(defaultDarkTheme, {
  colors: {
    'editor.background': '#1a1a2e',
    'editor.foreground': '#e0e0e0',
  },
})

<Editor.Root theme={customTheme}>
  {/* ... */}
</Editor.Root>

All theme tokens are exposed as CSS custom properties, so you can also override them in plain CSS.

Components

| Component | Description | | -------------------------- | ---------------------------------------------------------- | | Editor.Root | Top-level provider that accepts an adapter and theme | | Editor.FileTree | Virtualized, collapsible file tree sidebar | | Editor.Tabs | Tab bar for open files with drag-to-reorder | | Editor.Content | CodeMirror 6 editor pane for the active file | | Editor.Breadcrumbs | Path breadcrumb navigation for the active file | | Editor.StatusBar | Bottom bar showing cursor position, language, and encoding | | Editor.CommandPalette | Fuzzy-search command palette overlay | | Editor.Minimap | Scaled-down code overview in the editor gutter | | Editor.DiffViewer | Side-by-side or unified diff view for two file versions | | Editor.Panel | Resizable layout panel | | Editor.PanelGroup | Container that arranges panels horizontally or vertically | | Editor.PanelResizeHandle | Draggable handle between panels | | Editor.ContextMenu | Right-click context menu with customizable actions |

Hooks

| Hook | Description | | ------------------- | --------------------------------------------------------- | | useEditor | Access the editor instance, adapter, and top-level state | | useFileTree | Read the file tree and control expand/collapse state | | useTabs | Manage open tabs, active tab, and tab ordering | | useSearch | Trigger file and text search across the workspace | | useTheme | Read and update the active theme at runtime | | useKeybindings | Register and override keyboard shortcuts | | useConfig | Access and modify editor configuration | | useContextMenu | Control context menu visibility and register custom items | | useCommandPalette | Open the command palette and register custom commands |

Contributing

Contributions are welcome! Please read the Contributing Guide before opening a pull request.

License

MIT