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

@sublimee/backgrounds

v0.1.28

Published

Animated canvas backgrounds with zero-setup API

Readme

@sublimee/backgrounds

Animated canvas backgrounds for apps that already use shadcn/ui or a similar CSS-variable theme contract.

If you are an AI agent reading the installed npm package directly, start with AI_INDEX.md.

Use This Package When

  • you want a full-page animated background without wrapper boilerplate,
  • you want a contained animated background for a section or card,
  • you already have app theme variables such as --background, --foreground, and --primary.

First Move

import { AnimatedBackground } from "@sublimee/backgrounds";

<AnimatedBackground type="particle-field" />

Sound Wave

import { AnimatedBackground } from "@sublimee/backgrounds";

// Horizontal waves (default)
<AnimatedBackground type="sound-wave" />

// Vertical waves
<AnimatedBackground
  type="sound-wave"
  config={{ orientation: "vertical" }}
/>

// With custom styling
<AnimatedBackground
  type="sound-wave"
  config={{
    orientation: "horizontal",
    waveCount: 5,
    thickness: 3,
    amplitude: 60,
    frequency: 0.03,
    waveColor: "var(--primary)",
  }}
/>

// Multi-colored waves
<AnimatedBackground
  type="sound-wave"
  config={{
    orientation: "horizontal",
    waveCount: 6,
    thickness: 3,
    amplitude: 50,
    frequency: 0.02,
    speed: 0.8,
    waveColors: [
      "#FFD700", // Gold
      "#FFD700", // Gold
      "#000080", // Navy
      "#000080", // Navy
      "#000080", // Navy
      "#000080", // Navy
    ],
    bgColor: "#F5F5F5", // Whitesmoke
  }}
/>

In a standard shadcn/ui app, the default colors already target:

  • --background
  • --foreground
  • --primary

with hardcoded fallbacks when those variables are missing.

Recommended Usage With shadcn/ui

import { AnimatedBackground } from "@sublimee/backgrounds";

export function AppBackground() {
  return (
    <AnimatedBackground
      type="particle-field"
      config={{
        bgColor: "var(--background)",
        particleColor: "var(--foreground)",
        accentColor: "var(--primary)",
        shootingStarStyle: {
          color: "var(--primary)",
        },
      }}
    />
  );
}

Theme Contract

The package is designed around app-owned CSS variables.

Most useful variables in shadcn/ui setups:

  • --background
  • --foreground
  • --primary
  • --muted-foreground
  • --border
  • --ring

The canvas renderer resolves CSS variables on first render and re-resolves them when theme-related attributes change, including:

  • .dark
  • data-theme="dark"
  • system preference changes through prefers-color-scheme

Modern color formats such as oklch(...), hsl(...), rgb(...), and hex values are supported through browser-resolved computed colors.

Current Public Surface

Components

  • AnimatedBackground
  • ParticleFieldBackground
  • SoundWaveBackground

Current background types

  • particle-field
  • sound-wave

Important Defaults

  • AnimatedBackground is full-page by default
  • fixed={false} switches to contained mode
  • fixed mode uses inline positioning styles, so consumer Tailwind scanning is not required
  • default colors follow shadcn/ui variables before falling back to hardcoded values

API Notes

Full-page

<AnimatedBackground type="particle-field" />

Contained

<div className="relative h-64 overflow-hidden rounded-xl">
  <AnimatedBackground type="particle-field" fixed={false} />
</div>

Direct renderer

import { ParticleFieldBackground } from "@sublimee/backgrounds";

<ParticleFieldBackground fixed={false} particleCount={200} />

Layering

zIndex now accepts a normal CSS z-index value:

<AnimatedBackground type="particle-field" zIndex={0} />

High-Value Controls

ParticleField

  • particleCount
  • particleColor
  • accentColor
  • particleShape
  • particleTrail
  • shootingStarStyle
  • fps
  • fixed

SoundWave

  • orientation — "horizontal" | "vertical"
  • waveCount — number of waves
  • waveColor — wave line color (fallback when waveColors not provided)
  • waveColors — array of colors for each wave index (e.g., ["#FFD700", "#000080", "#fff"])
  • bgColor — background color
  • amplitude — wave height in pixels
  • frequency — wave compression
  • thickness — line thickness
  • speed — animation speed multiplier
  • fps
  • fixed

License

MIT