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

drab

v5.4.0

Published

A headless custom element library

Downloads

332

Readme

A Headless Custom Element Library

Features

drab focuses on providing JavaScript functionality where it's most useful. Many of the elements are helpful wrappers around browser APIs. Here are some of the features of the library.

Built on the web platform

  • Each element is a custom element. So you can use them with a framework, without one, or even directly in a markdown file. These components will work regardless of your project's architecture.
  • drab does not use the shadow DOM, so you can style content within these elements as usual with CSS.
  • Since you provide the HTML, these elements can take advantage of what JavaScript frameworks excel at---creating reusable markup that can be server side rendered.
  • Each element can be imported, extended, named, and used however you see fit.

Minimal bundle size

  • drab has zero dependencies.

Write JavaScript, or don't

  • Elements can be installed as a package (recommended), or utilized without writing any JavaScript by adding a script tag to your document.
  • Each element can be configured through HTML attributes, making it possible to use an alternative language for your backend.

Built in animations

  • Uses the web animations API for transitions.
  • Transitions are disabled for users who prefer reduced motion.
  • Extend the Animate element to build your own elements.

Contributing

Find an bug or have an idea? Feel free to create an issue on GitHub.

Since this is an headless library, simple elements like a badge that can be easily created with HTML and CSS are not included. Elements such as a select, or a date picker are also not included in favor of the native HTML elements.

Local Development

This library is built with TypeScript and tsup. The docs are built with Vite, domco, and TailwindCSS. The package contents are located in src/package.

  1. Clone the repository
  2. bun i
  3. bun dev

Making changes

  1. Add or edit the element in src/package---each element should extend Base or Animate. Each element has a index.ts file with the source code, and then a define.ts file where it is imported and called for use with a CDN.
  2. Add or edit the example in src/docs.
  3. Export the element from src/package/index.ts.
  4. Run bun doc to document your element with TypeDoc.
  5. Add the element as an entry point to tsup.config.ts, then run bun package to build with tsup.