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

@sarawebs/sb-components

v1.0.3

Published

SaraWebs components for web apps and tools

Readme

📦 @sarawebs/sb-components

A lightweight and modular component library from SaraWebs, starting with a fully reusable Dropdown system and built with flexibility in mind — perfect for client dashboards, internal tools, and modern web apps.

Designed with composition, zero dependencies, and real-world use in mind. More components coming soon 🚀.


✨ Features

  • 🧱 Composable Architecture Clean, class-based structure using best practices in reusable JavaScript.

  • 🔁 Multiple Instances Easily supports multiple dropdowns per page — all independently controlled.

  • 🖱️ Click or Hover Triggers Choose trigger behavior via data-trigger — no code changes required.

  • 🧩 Expandable Design Built as a foundation for future UI components like modals, tabs, toasts, and tooltips.

  • ⚙️ Zero Dependencies Lightweight and bundler-friendly. No need for jQuery or bulky UI libs.


📚 API Reference

Installation

npm install @sarawebs/sb-components

🧭 Current Component: Dropdown

HTML Example

<div class="dropdown" data-trigger="click">
  <button class="dropdown-toggle">Open Menu</button>
  <ul class="dropdown-menu">
    <li><a href="#">Option 1</a></li>
    <li><a href="#">Option 2</a></li>
  </ul>
</div>

You can switch behavior by using data-trigger="hover" instead.


JS Usage

import "@sarawebs/sb-components/Dropdown/style"; // basic styles
import { Dropdown } from '@sarawebs/sb-components/Dropdown';

document.querySelectorAll('.dropdown').forEach(dropdownEl => {
  new Dropdown(dropdownEl);
});

Class: Dropdown

| Method | Description | | ---------- | -------------------------------------- | | show() | Opens the dropdown programmatically | | hide() | Closes the dropdown | | toggle() | Toggles between open and closed states |

Data Attributes

| Attribute | Values | Description | | -------------- | ---------------------- | ---------------------------------- | | data-trigger | "click" | "hover" | Sets dropdown interaction behavior |


🎨 Styling (Basic)

.dropdown-menu {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  z-index: 1000;
}

.dropdown.show .dropdown-menu {
  display: block;
}

You can style or animate however you like. The module doesn’t enforce design.


🖼️ Component: Carousel

A lightweight, reusable Image Carousel component built with zero dependencies, perfect for showcasing images in client dashboards, landing pages, and web apps.

Designed with a clean class-based architecture following the same composition principles as the Dropdown component.


🎯 Features

  • ⬅️➡️ Arrow Controls — Navigate forward and backward through images
  • 🔄 Auto Slide — Automatically advances every N milliseconds
  • Navigation Dots — Visual indicators that are clickable to jump to any slide
  • 🧱 Composable & Reusable — Easily instantiate multiple carousels on a page
  • 🔧 Dynamic Content — Accepts an array of image URLs to render slides
  • ⏱️ Custom Timer — Configure auto-slide delay via constructor
  • ⚙️ No Dependencies — Pure vanilla JS with modular class design

📚 Usage

HTML Setup

Only an empty container is required. The component will dynamically populate it.

<div id="carousel-container"></div>

JS Initialization

import "@sarawebs/sb-components/Carousel/style"; // Basic styles
import { Carousel } from "@sarawebs/sb-components/Carousel";

const images = [
  'https://picsum.photos/id/1015/800/300',
  'https://picsum.photos/id/1016/800/300',
  'https://picsum.photos/id/1018/800/300',
];

const container = document.getElementById('carousel-container');

// 5-second timer (default)
new Carousel(container, images);

// OR with a custom interval (e.g., 3 seconds)
new Carousel(container, images, 3000);

screenshot

⚙️ Class: Carousel

| Parameter | Type | Description | | --------------------------- | --------- | ------------------------------------------ | | root | Element | HTML element to render the carousel inside | | images | string[] | Array of image URLs | | autoSlideDelay (optional) | number | Time in ms between slides (default: 5000) |


| Method | Description | | ------------------ | ----------------------------------------- | | moveToSlide(n) | Moves carousel to the nth slide (0-based) | | startAutoSlide() | Starts the auto-slide loop | | stopAutoSlide() | Stops the auto-slide loop |


💡 Use Cases

  • Homepage hero sliders
  • Product image galleries
  • Testimonials rotators
  • Portfolio slideshows
  • Embedded widgets in client dashboards

🚀 Integration

This component is built in the same modular style as other SaraWebs UI primitives like Dropdown, Modal, and upcoming tools — enabling consistent development across internal tools, marketing sites, and client-facing applications.


Let me know if you’d like to:

  • Add pause/resume buttons
  • Support swipe/touch gestures
  • Export this as an ES module or NPM package

🛠️ Planned Components

Coming soon:

  • ✅ Dropdown
  • ⏳ Modal
  • ⏳ Tooltip
  • ⏳ Toast
  • ⏳ Tab Switcher
  • ⏳ Collapsible Panels

💡 Use Cases

  • Navigation headers
  • Action menus (settings, logout, filters)
  • Admin panels and CMS UI
  • Reusable frontend patterns for small-to-medium apps

🌐 Website

Built with ❤️ by SaraWebs