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

jb-loading

v1.8.1

Published

loading web component

Downloads

1,409

Readme

jb-loading

Published on webcomponents.org GitHub license NPM Version GitHub Created At

SVG loading spinner web component.

  • Fills its host size.
  • Uses a lightweight SVG animation.
  • Customizable with CSS variables.
  • Works as a standalone web component or inside other JB components.

When to use

Use jb-loading for a visual loading indicator inside a button, empty state, panel, or page area. See it in the component examples.

Pair it with text, aria-busy, or aria-live on the surrounding UI when users need an accessible loading announcement.

Demo

Try the Storybook examples or open the GitHub Pages demo.

Using With JS Frameworks

See the React API and examples.

Other integrations: Angular · Vue · Nuxt · Svelte · SvelteKit · SolidJS · Lit · Next.js · Astro · Blazor · Server-rendered templates · WordPress · Alpine.js and HTMX

Installation

Using npm

npm i jb-loading
import 'jb-loading';
<jb-loading></jb-loading>

Using CDN

<script src="https://cdn.jsdelivr.net/npm/jb-loading/dist/JBLoading.umd.js"></script>
<jb-loading></jb-loading>

API reference

Attributes

jb-loading does not currently define public HTML attributes.

Properties

jb-loading does not currently define public JavaScript properties.

Methods

jb-loading does not currently define public methods.

Events

The lifecycle example verifies both events dispatched when the component connects. Demo

| event | detail | description | | --- | --- | --- | | load | none | Dispatched from connectedCallback when the component is connected. | | init | none | Dispatched from connectedCallback after load. |

Slots and CSS parts

jb-loading does not expose public slots. Its CSS parts are demonstrated in the style gallery:

| CSS part | description | | --- | --- | | loading-wrapper | Wrapper around the spinner SVG. | | loading-svg | Animated spinner SVG. | | loading-circle | Visible spinner circle. |

Custom style

For complete styling guidance, live examples, and copyable style recipes, see the Styling guide and style gallery.

Set CSS variables in the parent scope of the component.

| CSS variable name | description | | --- | --- | | --jb-loading-color | Spinner stroke color. | | --jb-loading-width | Host width. Default is 100%. | | --jb-loading-height | Host height. Default is 100%. |

jb-loading {
  --jb-loading-width: 2.75rem;
  --jb-loading-height: 2.75rem;
  --jb-loading-color: var(--jb-primary);
}

Accessibility notes

jb-loading is a visual spinner. Add accessible loading semantics to the surrounding UI when needed. Accessible usage example

<div aria-busy="true" aria-live="polite">
  <jb-loading style="--jb-loading-width: 1.5rem; --jb-loading-height: 1.5rem;"></jb-loading>
  <span>Loading</span>
</div>

Related Docs

AI agent notes

  • Import jb-loading once before using <jb-loading>.
  • Do not expect attributes, properties, methods, or slots; customize with CSS variables and the documented CSS parts.
  • Set size with --jb-loading-width and --jb-loading-height or you can set width/height directly.
  • Set color with --jb-loading-color.
  • Add accessible loading text or state outside the component when the loading state must be announced.
  • This package includes custom-elements.json and points to it with the package.json customElements field. The field is documented by the Custom Elements Manifest project in Referencing manifests from npm packages.
  • In custom-elements.json, exports.kind: "js" describes the JavaScript/TypeScript class export and exports.kind: "custom-element-definition" maps the jb-loading tag name to that class.