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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-devbar

v1.0.1

Published

A customizable floating toolbar for React applications. Build and integrate your own dev tools with a draggable interface inspired by the Vercel toolbar. Perfect for adding debugging panels, theme controls, and other development utilities to your app.

Downloads

126

Readme

📏 react-devbar

A customizable floating toolbar for React applications. Build and integrate your own dev tools with a draggable interface inspired by the Vercel toolbar. Perfect for adding debugging panels, theme controls, and other development utilities for your app. Check out the Storybook for a live demo.

Screenshot of react-devbar

✨ Features

  • ✅ Fully customizable, with custom icons, styles, and components.
  • ✅ Toggle it with a hotkey.
  • ✅ Drag it anywhere on the screen.
  • ✅ Use default styles or style it yourself. Seamlessly integrates with Tailwind and supports dark-mode.

📡 Install

npm install react-devbar

yarn add react-devbar

pnpm add react-devbar

👋 Hello there! Follow me @linesofcode or visit linesofcode.dev for more cool projects like this one.

🚀 Getting started

import { DevBar } from "react-devbar";
import { Bug, Palette, Settings } from "lucide-react";
// if you're not using Tailwind, you can import default styles
import "react-devbar/styles.css";

const tools = [
	{
		icon: Settings,
	},
	{
		icon: Palette,
	},
	{
		icon: Bug,
	},
];


// somewhere in your app render:
<DevBar tools={tools} />

Available props

DevBarTool

Each tool in the tools array can have the following properties:

| Property | Type | Required | Description | |------------|----------------------|----------|------------------------------------------------------------| | name | string | No | The name of the tool (used for tooltips) | | icon | React.ElementType | Yes | The icon component to display | | Component | React.ComponentType | No | The component to render when the tool is selected |

DevBarProps

| Property | Type | Default | Description | |--------------------------|-------------------------------------------|-------------|----------------------------------------------------------------| | tools | Tool[] | - | Array of tools to display in the toolbar | | orientation | "horizontal" | "vertical" | "horizontal"| Orientation of the toolbar | | defaultPosition | Position | { x: number; y: number } | "bottom-right" | Initial position of the toolbar | | defaultOpen | boolean | false | Whether the toolbar is initially open | | hotkey | string | - | Keyboard shortcut to toggle the toolbar | | hotKeyOptions | Options | - | Options for the hotkey behavior | | CommandIcon | React.ElementType | - | Custom command icon component | | GripIcon | React.ElementType | - | Custom grip icon component | | CloseIcon | React.ElementType | - | Custom close icon component | | containerClassName | string | - | Class name for the main container | | toolbarClassName | string | - | Class name for the toolbar | | toolbarContentClassName | string | - | Class name for the toolbar content | | moveButtonClassName | string | - | Class name for the move button | | toolsContainerClassName | string | - | Class name for the tools container | | toolButtonClassName | string | - | Class name for individual tool buttons | | controlsContainerClassName | string | - | Class name for the controls container | | closeButtonClassName | string | - | Class name for the close button | | openButtonClassName | string | - | Class name for the open button | | ButtonComponent | typeof Button | - | Custom button component | | TooltipComponent | typeof Tooltip | - | Custom tooltip component | | TooltipTriggerComponent | typeof TooltipTrigger | - | Custom tooltip trigger component | | TooltipContentComponent | typeof TooltipContent | - | Custom tooltip content component | | TooltipProviderComponent| typeof TooltipProvider | - | Custom tooltip provider component | | moveButtonLabel | string | - | Accessibility label for the move button | | closeToolbarLabel | string | - | Accessibility label for the close button | | openToolbarLabel | string | - | Accessibility label for the open button |

DevBarPosition Types

The defaultPosition prop accepts the following position values:

  • "top-left"
  • "top-center"
  • "top-right"
  • "bottom-left"
  • "bottom-center"
  • "bottom-right"
  • "center-left"
  • "center-right"
  • "center"

Or an object with x and y coordinates for precise positioning.