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

react-sidebar-lite

v1.0.4

Published

A lightweight, customizable React Sidebar library.

Readme

React Sidebar Lite

NPM MIT License

A lightweight, animated, and highly customizable sidebar component for React, built with Tailwind CSS and Framer Motion.

react-sidebar-lite provides a simple and elegant solution for creating collapsible navigation sidebars. It's designed to be easy to use, yet flexible enough for various use cases.

Features

  • Lightweight: Minimal dependencies and a small footprint.
  • Animated: Smooth collapse and expand animations powered by Framer Motion.
  • Customizable: Style the components using Tailwind CSS utility classes. Override default styles with your own.
  • Composable: Built with a clear and composable API.
  • TypeScript Support: Written in TypeScript with type definitions included.
  • Icon Support: Easily add icons from libraries like lucide-react.

Installation

npm install react-sidebar-lite framer-motion lucide-react
# or
yarn add react-sidebar-lite framer-motion lucide-react

Note: react, react-dom, framer-motion, and lucide-react are peer dependencies.

Usage

First, you need to import the CSS file in your application's entry point:

import 'react-sidebar-lite/dist/styles.css';

Then, you can use the Sidebar component and its sub-components:

import React from 'react';
import { Sidebar } from 'react-sidebar-lite';
import { LayoutDashboard, Settings, User, LogOut, Home } from 'lucide-react';

export default function App() {
  return (
    <div className="flex h-screen bg-gray-50">
      <Sidebar>
        {/* Header */}
        <div className="flex h-16 items-center justify-center border-b border-gray-200 p-4">
           <div className="h-8 w-8 rounded bg-blue-600" />
        </div>

        <Sidebar.Toggle />

        <div className="flex-1 overflow-y-auto py-4">
          <Sidebar.Section>
            <Sidebar.Item icon={<Home size={20} />} text="Home" />
            <Sidebar.Item icon={<LayoutDashboard size={20} />} text="Dashboard" active />
          </Sidebar.Section>

          <Sidebar.Section title="Management">
            <Sidebar.Item icon={<User size={20} />} text="Users" />
            <Sidebar.Item icon={<Settings size={20} />} text="Settings" alert />
          </Sidebar.Section>
        </div>

        <div className="border-t border-gray-200 p-2">
          <Sidebar.Item icon={<LogOut size={20} />} text="Logout" />
        </div>
      </Sidebar>

      <main className="flex-1 p-8">
        <h1 className="text-2xl font-bold">Content Area</h1>
        <p className="mt-2 text-gray-600">Resize the window or click the toggle to test.</p>
      </main>
    </div>
  );
}

Components

<Sidebar>

The main container for the sidebar. It's a nav element that controls the expanded/collapsed state.

| Prop | Type | Default | Description | | --- | --- | --- | --- | | children | ReactNode | - | The content of the sidebar. | | defaultExpanded | boolean | true | The initial expanded state. | | expanded | boolean | - | Controlled expanded state. | | onExpandedChange| (expanded: boolean) => void | - | Callback for when the expanded state changes. | | className | string | - | Additional classes for the nav element. |

<Sidebar.Item>

A clickable item inside the sidebar. It's a button element.

| Prop | Type | Description | | --- | --- | --- | | icon | ReactNode | An icon to display next to the text. | | text | string | The text to display. | | active | boolean | If true, applies active styles. | | alert | boolean | If true, shows a small alert dot. | | onClick | () => void| Callback for when the item is clicked. | | className | string | Additional classes for the button element. |

<Sidebar.Section>

A component to group sidebar items. It's a div element.

| Prop | Type | Description | | --- | --- | --- | | title | string | An optional title for the section. | | children| ReactNode | The content of the section, usually Sidebar.Items. | | className| string | Additional classes for the div element. |

<Sidebar.Toggle>

A button to toggle the sidebar's expanded/collapsed state.

| Prop | Type | Description | | --- | --- | --- | | className | string | Additional classes for the button element. |

Customization

You can customize the sidebar's appearance using Tailwind CSS. The default styles are defined with CSS variables, which you can override.

For example, to change the width of the expanded sidebar, you can define --rs-width-expanded in your own CSS file:

:root {
  --rs-width-expanded: 300px;
}

Here are the available CSS variables:

| Variable | Default | Description | | --- | --- | --- | | --rs-width-expanded | 260px | Width of the expanded sidebar. | | --rs-width-collapsed| 64px | Width of the collapsed sidebar. |

You can also override the component styles by targeting the rs- prefixed classes in your own CSS.

License

This project is licensed under the MIT License - see the LICENSE file for details.