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

@shader-gallery/vue

v0.1.0

Published

Vue 3 component for shader.gallery animated WebGL backgrounds — one tag, themeable from props.

Readme

@shader-gallery/vue

Vue 3 components for shader.gallery animated WebGL backgrounds. Two ways in: fetch a shader by slug from the CDN, or bundle one .frag with your app.

npm install @shader-gallery/vue @shader-gallery/runtime

<ShaderGalleryBg> — fetch by slug

The default. Renders a <canvas> and drives the shader through @shader-gallery/runtime (a real Vue component, not a wrapper around the web component). The GLSL streams from the CDN by slug at runtime, so your bundle stays tiny and the catalog can update without a package release.

<script setup>
import { ShaderGalleryBg } from '@shader-gallery/vue';
</script>

<template>
  <section style="position: relative; min-height: 100vh">
    <ShaderGalleryBg
      slug="nacre"
      palette="witchlight"
      :style="{ position: 'fixed', inset: 0, zIndex: -1 }"
    />
    <h1>Backgrounds that glow in the dark</h1>
  </section>
</template>

Override uniforms and post-FX by name. These retarget the running shader without rebuilding the WebGL context, so they are cheap to drive from a ref:

<script setup>
import { ref } from 'vue';
import { ShaderGalleryBg } from '@shader-gallery/vue';

const glow = ref(1.0);
</script>

<template>
  <ShaderGalleryBg
    slug="nacre"
    palette="ember"
    :uniforms="{ u_glow: glow }"
    :post="{ bloom: 1.2, grain: 0.15 }"
    :style="{ position: 'fixed', inset: 0 }"
  />
  <input type="range" min="0" max="2" step="0.01" v-model.number="glow" />
</template>

Props

| Prop | Type | Notes | |-------------|---------------------------|-------| | slug | string | Which shader to load from the CDN. | | palette | string | Theme name; defaults to the shader's own. Changes live. | | base | string | Data source URL. Defaults to the production CDN; point at http://localhost:…/ or a Cloudflare tunnel during dev. | | uniforms | object | Overrides over the shader's defaults, e.g. { u_glow: 1.4 }. Apply live (watched deep). | | post | object | Post-FX overrides, e.g. { bloom: 1.2 }. Apply live (watched deep). | | frag,meta | string, object | Provide the shader directly instead of fetching by slug (bundled/offline). |

palette, uniforms and post retarget the running shader without rebuilding the WebGL context; slug/base/frag remount. class/style fall through to the canvas.

shader() — bundle one frag

The complement to <ShaderGalleryBg>: instead of fetching by slug, this carries the GLSL with you (offline, versioned, tree-shaken). Each float param becomes a declared Number prop (u_waveSpeedwaveSpeed, bound as :wave-speed in templates); palette and post are universal.

A shader.gallery effect is one self-contained .frag with an embedded /*@shader … */ JSON header. Author your own, or copy the reference effect that @shader-gallery/components ships on disk at node_modules/@shader-gallery/components/effects/billow.frag (params waveSpeed / swell / cross).

<script setup>
import { ref } from 'vue';
import { shader } from '@shader-gallery/vue';
import billowSrc from './billow.frag?raw';   // Vite/webpack raw import

const Billow = shader(billowSrc);
const waveSpeed = ref(0.35);
</script>

<template>
  <Billow :wave-speed="waveSpeed" palette="opal" :style="{ position: 'fixed', inset: 0 }" />
  <input type="range" min="0" max="2" step="0.01" v-model.number="waveSpeed" />
</template>

./billow.frag?raw is the Vite/webpack way to import a file as a string. On a setup without raw imports, read the file to a string yourself and pass it to shader() — or use <ShaderGalleryBg :frag="…" :meta="…" />.

Generate per-effect prop types with sg-typegen (from @shader-gallery/components) for autocomplete:

npx sg-typegen billow.frag --out billow.d.ts

SSR

Safe. The component renders a bare <canvas> on the server; the WebGL mount runs in onMounted (client-only).

MIT © E. T. Carter · shader.gallery · [email protected]