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

border-beam-vanilla

v1.0.2

Published

Animated border beam effect for Vanilla JavaScript

Readme

border-beam-vanilla

The Vanilla JavaScript Version of Jakubantalik's border-beam (https://github.com/Jakubantalik/border-beam).

Live Demo

Live Demo

border-beam-vanilla adds a traveling glow to any existing DOM element. The package targets plain JavaScript projects, decorates elements in place, and exposes a small controller API for updates and cleanup.

Install

npm install border-beam-vanilla

Quick Start

import { attachBorderBeam } from 'border-beam-vanilla';

const card = document.querySelector('.card');

attachBorderBeam(card, {
  size: 'md',
  colorVariant: 'colorful',
});

API

attachBorderBeam(element, options?)

Attaches the effect to an existing HTMLElement and returns a controller.

const controller = attachBorderBeam(button, {
  size: 'sm',
  theme: 'dark',
  strength: 0.8,
});

Controller methods:

  • controller.update(nextOptions) updates the active instance without recreating the element.
  • controller.setActive(active) starts or fades out the animation.
  • controller.destroy() removes injected styles, observers, and bloom nodes.

createBorderBeam(options?)

Creates a new <div>, attaches the effect, and returns the same controller shape with the created element.

import { createBorderBeam } from 'border-beam-vanilla';

const beam = createBorderBeam({ size: 'md' });
beam.element.className = 'card';
beam.element.textContent = 'Hello';
document.body.appendChild(beam.element);

Options

| Option | Type | Default | Notes | | --- | --- | --- | --- | | size | 'sm' \| 'md' \| 'line' | 'md' | Chooses the preset geometry and animation style. | | colorVariant | 'colorful' \| 'mono' \| 'ocean' \| 'sunset' | 'colorful' | Selects the tuned color palette. | | theme | 'dark' \| 'light' \| 'auto' | 'dark' | auto follows prefers-color-scheme. | | staticColors | boolean | false | Disables hue shifting. Mono always stays static. | | duration | number | 1.96 or 2.4 | Duration is in seconds. | | active | boolean | true | Controls fade-in and fade-out state. | | borderRadius | number | auto-detected | Falls back to the element border radius, then the preset default. | | brightness | number | 1.3 | Adjusts glow intensity. | | saturation | number | preset-based | Uses per-theme tuning unless you override it. | | hueRange | number | 30 | The line preset caps the range to keep the effect controlled. | | strength | number | 1 | Clamped between 0 and 1. | | onActivate | () => void | undefined | Fires after the fade-in animation completes. | | onDeactivate | () => void | undefined | Fires after the fade-out animation completes. |

Presets

  • sm uses a compact border glow for icon buttons and pills.
  • md uses the full border travel effect for cards, panels, and larger controls.
  • line concentrates the effect along the bottom edge for inputs and search bars.

Behavior Notes

  • The library decorates the target element directly. It does not wrap or replace your DOM node.
  • If the target element uses position: static, the runtime temporarily sets it to relative so the effect layers can anchor correctly.
  • The injected effect layers use pointer-events: none, so they do not block clicks or focus.
  • The package targets modern browsers that support the CSS features used by the effect.

Development

npm run build
npm run test