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

@berenjena/react-dev-panel

v2.3.0

Published

A React development panel with various tools and utilities.

Readme

React Dev P- Zero Configuration - Auto-mounting and unmounting, no providers or setup requirednel

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

A powerful, type-safe development panel for React that allows developers to inspect and control component props, manage state, and accelerate prototyping directly within the application UI.

✨ Features

  • 🎛️ Rich Control Types - Boolean, Number, Text, Select, Color, Range, Date, Button, ButtonGroup, and Separator controls
  • Automatic Persistence - Control values automatically saved to localStorage and restored on reload
  • �🚀 Zero Configuration - Auto-mounting and unmounting, no providers or setup required
  • 🎨 Themeable - Built-in themes and CSS custom properties for customization
  • ⌨️ Keyboard Shortcuts - Customizable hotkeys for panel toggle
  • 📖 TypeScript First - Full type safety and IntelliSense support
  • Auto State Management - Automatic portal rendering and lifecycle management
  • 📦 Lightweight - Only requires React as peer dependency

📦 Installation

npm install -D @berenjena/react-dev-panel
yarn add -D @berenjena/react-dev-panel
pnpm add -D @berenjena/react-dev-panel

Quick Start

The package exposes a single hook: useDevPanel. This hook handles everything automatically:

  • Auto-mounting: Creates and mounts the dev panel UI when first called
  • Auto-unmounting: Removes the panel from DOM when no controls are active
  • State management: Manages all internal state and control synchronization
  • Portal rendering: Renders the panel outside your component tree

Basic Usage

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

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

	useDevPanel("User Settings", {
		name: {
			type: "text",
			value: name,
			label: "Full Name",
			persist: true, // Automatically save and restore value
			onChange: setName,
		},
		age: {
			type: "number",
			value: age,
			label: "Age",
			min: 0,
			max: 120,
			persist: true, // Value persists across page reloads
			onChange: setAge,
		},
		isActive: {
			type: "boolean",
			value: isActive,
			label: "Active User",
			persist: true,
			onChange: setIsActive,
		},
		theme: {
			type: "select",
			value: theme,
			label: "Theme",
			options: ["light", "dark", "auto"],
			persist: true,
			onChange: setTheme,
		},
	});

	return (
		<div>
			<h1>Hello, {name}!</h1>
			<p>Age: {age}</p>
			<p>Status: {isActive ? "Active" : "Inactive"}</p>
			<p>Theme: {theme}</p>
		</div>
	);
}

That's it! No additional components or providers needed. The hook automatically handles the entire panel lifecycle.

🎛️ Control Types

React Dev Panel provides rich control types for different data types. Here are some quick examples:

Text Control

{
  type: 'text',
  value: 'Hello World',
  label: 'Message',
  placeholder: 'Enter message...',
  persist: true, // Value automatically saved to localStorage
  onChange: (value: string) => setValue(value),
}

Number Control

{
  type: 'number',
  value: 42,
  label: 'Count',
  min: 0,
  max: 100,
  persist: true, // Persists across page reloads
  onChange: (value: number) => setValue(value),
}

Boolean Control

{
  type: 'boolean',
  value: true,
  label: 'Enable Feature',
  persist: true, // Checkbox state is remembered
  onChange: (value: boolean) => setValue(value),
}

Color Control

{
  type: 'color',
  value: '#ff6200',
  label: 'Theme Color',
  persist: true, // Color choice is automatically saved
  onChange: (value: string) => setValue(value),
}

Button Control

{
  type: 'button',
  label: 'Reset Values',
  onClick: () => resetToDefaults(),
}

📖 View all control types and detailed documentation →

🎨 Styling and Theming

The dev panel uses CSS custom properties for easy theming. Here's a quick example:

:root {
	--dev-panel-background-color: #1a1a1a;
	--dev-panel-text-color: #ffffff;
	--dev-panel-accent-color: #ff6200;
	--dev-panel-border-color: #333333;
}

📖 Complete theming guide and customization options →

⌨️ Keyboard Shortcuts

The dev panel supports customizable keyboard shortcuts. The default hotkey is Ctrl+Shift+A:

useDevPanel("My Section", controls, {
	hotKeyConfig: {
		key: "d", // The key to press
		ctrlKey: true, // Requires Ctrl key
		shiftKey: false, // Requires Shift key
		altKey: true, // Requires Alt key
		metaKey: false, // Requires Meta/Cmd key (Mac)
	},
});

Advanced Usage

Multiple Panel Sections

You can call useDevPanel from multiple components to create organized sections:

function App() {
	// In UserProfile.tsx
	useDevPanel("User Profile", {
		name: { type: "text", value: name, onChange: setName },
		avatar: { type: "text", value: avatar, onChange: setAvatar },
	});

	// In AppSettings.tsx
	useDevPanel("App Settings", {
		theme: { type: "select", value: theme, options: ["light", "dark"], onChange: setTheme },
		debug: { type: "boolean", value: debug, onChange: setDebug },
	});

	// Both sections appear in the same panel automatically
	return <YourApp />;
}

Panel Configuration

Customize the panel's appearance and behavior:

useDevPanel("My Section", controls, {
	panelTitle: "Custom Panel Title",
	theme: "dark", // Built-in themes: light, dark, neon, etc.
	hotKeyConfig: {
		// Custom toggle hotkey (default: Ctrl+Shift+A)
		key: "f",
		ctrlKey: true,
		shiftKey: true,
		altKey: false,
		metaKey: false,
	},
});

Event Handling Options

React Dev Panel supports two different event handling strategies for input controls:

onChange Event: Provides real-time updates as the user types or interacts with the control. This is ideal for immediate feedback and live previews, but may trigger more frequent re-renders.

onBlur Event: Updates the value only when the user finishes interacting with the control (loses focus). This approach is more performance-friendly for expensive operations and provides a better user experience when dealing with API calls or heavy computations.

{
  type: 'text',
  value: searchTerm,
  event: 'onChange', // Real-time updates
  onChange: setSearchTerm,
}

{
  type: 'number',
  value: price,
  event: 'onBlur', // Update only when focus is lost
  onChange: setPrice,
}

📚 Documentation

Core Guides

Development

📚 API Reference

useDevPanel(sectionName, controls, devPanelProps?)

The only export from this package. This hook manages the entire dev panel lifecycle and handles all the heavy lifting for you.

Parameters:

  • sectionName - Unique identifier for the control group
  • controls - Object containing control definitions
  • devPanelProps - Optional panel configuration (title, theme, hotkeys)

What it does automatically:

  • Portal Management: Creates a React portal on first use and renders the panel outside your component tree
  • State Synchronization: Keeps all controls in sync across multiple component instances
  • Lifecycle Management: Mounts the panel when controls are registered, unmounts when all controls are removed
  • Memory Management: Cleans up subscriptions and DOM elements when components unmount
  • Theme Application: Applies theme configurations and CSS custom properties

🛠️ Development

Want to contribute or set up the project locally?

React Dev Panel maintains high code quality standards with comprehensive tooling:

  • 🔍 ESLint - Comprehensive linting for TypeScript and React
  • 💅 Prettier - Automatic code formatting
  • 🎨 Stylelint - CSS/SCSS linting and formatting
  • 📝 Commitlint - Conventional commit message validation
  • 🪝 Husky - Pre-commit hooks for quality assurance
  • 📦 Changesets - Automated version management and releases

All quality checks run automatically via pre-commit hooks, ensuring consistent code quality.

📖 Development setup, contributing guidelines, and project structure →

📖 Storybook

Explore all components and controls in our Storybook:

npm run storybook

Visit http://localhost:6006 to see interactive examples and documentation.

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

🔗 Links


Made with ❤️ by the Berenjena team