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

@berenjena/react-dev-panel

v2.5.1

Published

A React development panel with various tools and utilities.

Readme

React Dev Panel

NPM Version npm package minimized gzipped size License: MIT Weekly Downloads

A lightweight, type-safe development panel for React that lets you control component state and props in real-time during development.

Features

  • One Hook: Single useDevPanel hook - no providers, no setup
  • 13 Control Types: Text, Number, Boolean, Select, Color, Range, Date, Button, LocalStorage, and more
  • Auto-Persistence: Optional localStorage sync for control values
  • Type-Safe: Full TypeScript support with IntelliSense
  • Themeable: 21 built-in themes + CSS custom properties
  • Lightweight: ~16 KB gzipped, zero runtime dependencies

Installation

npm install -D @berenjena/react-dev-panel

Quick Start

import { useState } from "react";
import { useDevPanel } from "@berenjena/react-dev-panel";

function App() {
	const [name, setName] = useState("John");
	const [age, setAge] = useState(25);
	const [theme, setTheme] = useState("dark");

	useDevPanel("Settings", {
		name: { type: "text", value: name, onChange: setName },
		age: { type: "number", value: age, min: 0, max: 100, onChange: setAge },
		theme: { type: "select", value: theme, options: ["light", "dark"], onChange: setTheme },
	});

	return <div>Hello, {name}!</div>;
}

That's it! Press Ctrl+Shift+A to toggle the panel.

Control Types

All 13 control types available:

{
  text: { type: "text", value: string, onChange: (v) => void }
  number: { type: "number", value: number, min?: number, max?: number, onChange: (v) => void }
  boolean: { type: "boolean", value: boolean, onChange: (v) => void }
  select: { type: "select", value: string, options: string[], onChange: (v) => void }
  multiselect: { type: "multiselect", value: string[], options: string[], onChange: (v) => void }
  color: { type: "color", value: string, onChange: (v) => void }
  range: { type: "range", value: number, min: number, max: number, step?: number, onChange: (v) => void }
  date: { type: "date", value: string, min?: string, max?: string, onChange: (v) => void }
  button: { type: "button", onClick: () => void }
  buttonGroup: { type: "buttonGroup", buttons: Array<{label: string, onClick: () => void}> }
  dragAndDrop: { type: "dragAndDrop", onChange: (files: FileList) => void }
  localStorage: { type: "localStorage", onRefresh?: () => void }
  separator: { type: "separator", variant?: "line" | "label" | "space" }
}

Common options (available on most controls):

  • label?: string - Display label
  • description?: string - Help text
  • disabled?: boolean - Disable control
  • persist?: boolean - Auto-save to localStorage

📖 Full control documentation →

Configuration

Custom Hotkey

useDevPanel("Settings", controls, {
	hotKeyConfig: { key: "d", ctrlKey: true, shiftKey: true },
});

Open from the console

Once the panel is in use, a devPanel helper is available on window so you can drive it straight from the browser console — handy when the hotkey clashes with another shortcut:

devPanel.open(); // show the panel
devPanel.close(); // hide it
devPanel.toggle(); // flip visibility (same as the hotkey)

It's registered automatically when the first (enabled) useDevPanel call mounts, so it isn't present in builds where the panel is disabled.

Panel Theme

useDevPanel("Settings", controls, {
	theme: "neon", // 21 built-in themes available
	panelTitle: "My Dev Panel",
});

Event Handling

Choose when controls trigger updates:

{
  type: "text",
  value: searchTerm,
  event: "onChange", // Update on every keystroke (default)
  onChange: setSearchTerm
}

{
  type: "text",
  value: apiKey,
  event: "onBlur", // Update only when focus is lost
  onChange: setApiKey
}

Disabling in Production

Use the enabled flag to turn the panel off at runtime. When false, the call is a no-op — the section is not registered and the panel does not mount. It defaults to true.

useDevPanel("Settings", controls, {
	enabled: import.meta.env.DEV, // Vite
	// enabled: process.env.NODE_ENV !== "production", // Webpack / Next / CRA
});

⚠️ enabled does not remove the panel from your bundle. It stops the panel from running, but the library code is still imported and shipped to users. To strip the code out of production builds entirely (e.g. a Vite plugin that stubs the package), see the Production & SSR guide.

SSR / Next.js

The package is import-safe on the server (it never touches document/localStorage at import time) and ships the "use client" directive, so it works under the Next.js App Router. The panel mounts and renders on the client only.

📖 Styling guide | Event handling | Advanced usage | Production & SSR

Documentation

Guides:

Live Examples:

  • Storybook - Interactive component demos
  • Run locally: npm run storybook

API Reference

useDevPanel(sectionName, controls, options?)

Parameters:

  • sectionName: string - Unique identifier for this control group
  • controls: ControlsGroup - Object mapping control keys to control definitions
  • options?: DevPanelProps - Optional configuration

Options:

{
  panelTitle?: string;           // Custom panel header
  theme?: string;                // Built-in theme name
  enabled?: boolean;             // Activate this call (default true; false = no-op)
  hotKeyConfig?: {               // Custom toggle hotkey
    key: string;
    ctrlKey?: boolean;
    shiftKey?: boolean;
    altKey?: boolean;
    metaKey?: boolean;
  }
}

enabled gates runtime behaviour only — it does not remove the panel from your bundle. See the Production & SSR guide for build-time stripping.

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Development:

git clone https://github.com/Berenjenas/react-dev-panel.git
cd react-dev-panel
npm install
npm run storybook

License

MIT © Berenjena


Links: NPM · GitHub · Issues · Berenjena


Made with ❤️ by the Berenjena team