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

@sophat/sidebar

v0.0.2

Published

@sophat/sidebar build for sidebar ui supported with tailwindcss

Downloads

15

Readme

Sample Sidebar

📐 DEMO

Demo

npm: @sophat/sidebar

The @sophat/sidebar project package build for sidebar ui supported with tailwindcss.

⬇️ Installation

npm install @sophat/sidebar --dev

📂 Usage

If position: 'left' Sidebar show up left position {buttonPosition} should be 'right' (optional) If position: 'right' Sidebar show up right position {buttonPosition} should be 'left' (optional)

Module Script

import { Sidebar } from "@sophat/sidebar";

/**
 * @param position: 'left' | 'right'
 * @param buttonPosition: 'left' | 'right' | 'center'
*/
new Sidebar();

HTML

<!-- Button -->
<button type="button" title="Left" aria-label="Close Collapse Sidebar" data-sidebar-target="sidebar-left" class="flex items-center justify-center w-8 h-8 rounded-lg hover:bg-slate-50 ring-1 ring-black/10">
    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
        <path stroke-linecap="round" stroke-linejoin="round" d="M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3" />
    </svg>
</button>

<!-- Sidebar Backdrop -->
<div data-sidebar-backdrop="sidebar-left" data-sidebar-target="sidebar-left" class="hidden inset-0 fixed right-0 transition-opacity top-0 w-full h-full bg-black/25 z-[999]"></div>

<!-- Sidebar -->
<div data-sidebar="sidebar-left" data-sidebar-position="left" class="hidden justify-end fixed top-0 opacity-0 transition-all duration-500 w-0 max-w-[90%] h-full bg-white shadow-[-2px_0_20px_0_#00000022] z-[9999]">
    <div class="grid content-start w-full h-full grid-cols-1">

        <!-- Header -->
        <div data-button-position="right" class="flex items-center h-12 px-2">
            <button type="button" aria-label="Close Collapse Sidebar" data-sidebar-target="sidebar-left" class="flex items-center justify-center rounded-lg hover:bg-slate-50 ring-1 ring-black/10 w-7 h-7">
                <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18" />
                </svg>
            </button>
        </div>

        <!-- Content -->
        <ul role="list" class="flex items-center justify-center flex-col h-full min-h-[calc(100vh_-48px)] bg-slate-100 gap-2 px-5 overflow-x-hidden overflow-y-auto py-7">
            <li class="pb-2 text-sm font-semibold font-content text-slate-700">
                Content Here
            </li>
        </ul>

    </div>
</div>

🪲 Bugs

Bug Report