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

@instantshader/react

v0.8.1

Published

React components for InstantShader: animated WebGL gradients and image effects.

Readme

InstantShader

@instantshader/react

React components for instantshader, animated WebGL gradients with zero dependencies. Put a shader component in any sized element, and add dither, pixelate, halftone, ASCII or tint effects over it or over your own image. Built by InstantGradient.

Install

npm install @instantshader/react

Usage

import { Flow } from "@instantshader/react";

export function Background() {
  return (
    <Flow
      colors={["#4f46e5", "#ec4899", "#22d3ee"]}
      style={{ width: "100%", height: "100%" }}
    />
  );
}

Shaders

One component per shader, all with the same props:

| Component | Look | Params | | --- | --- | --- | | <Flow> | Swirling fluid currents with bright edges and calm open space. | scale, curl, drift, openness, grain | | <Beam> | One wide beam of soft light across a near-black frame, the palette running along it. | scale, width, glow, angle, grain | | <Bloom> | A fan of huge soft petals rising from the bottom edge. | scale, petals, pinch, bend, sway, colorflow, grain | | <Halo> | An eclipse: a dark disc with a bright rim and a corona. x / y place it; the default is a glowing horizon. | radius, x, y, glow, crescent, flares, grain | | <Strata> | Stacked cut-paper layers with soft shadows. | scale, layers, warp, ridges, stretch, depth, blend, angle, grain | | <Dune> | Overlapping crests, crisp on top and fading out below. | layers, swell, waves, fade, soft, angle, grain | | <Whorl> | A spiral of curved blades, positionable with x / y. | blades, twist, depth, scale, wobble, x, y, grain | | <Silk> | Satin folds with a highlight along the threads. | scale, folds, depth, warp, sheen, light, grain | | <Nacre> | Glassy liquid folds whose colour shifts on every slope. | scale, flow, crease, depth, iridescence, light, grain | | <Burst> | Thin rays out of one point, tunnel or star, straight or twisted. | rays, sharp, glow, twist, x, y, grain | | <Glint> | A shoal of spinning shards streaming along a current. | size, density, bend, angle, speed, grain |

import { Bloom } from "@instantshader/react";

<Bloom
  colors={["#ffd9e8", "#ffb300", "#ff8fc0", "#3d7bff", "#0a2e14"]}
  // bloom has two independent motion modes: petals that breathe and lean,
  // and colours that travel outward through a still pattern.
  params={{ sway: 0.5, colorflow: 0.4 }}
  style={{ width: "100%", height: "100%" }}
/>;

See the instantshader README for what each param does and for the shader defs themselves (re-exported from here as flow, beam, bloom, halo, strata, dune, whorl, silk, nacre, burst and glint).

Effects

Every shader component takes an effects prop: a list of layers, bottom first. Each layer works on everything below it, so effects stack.

import { Bloom, dither } from "@instantshader/react";

<Bloom
  colors={["#140f30", "#9c2168", "#eb6a4e", "#fcd87c"]}
  effects={[{ effect: dither, params: { pattern: "blueNoise", colorMode: "palette", levels: 4, blend: "normal", opacity: 1 } }]}
  style={{ width: "100%", height: "100%" }}
/>;

<ShaderStack> takes a source instead of a fixed shader, which is how you put effects over an image. Any <img>, <canvas> or <video> element works as media:

import { ShaderStack, halftone, tint } from "@instantshader/react";

<ShaderStack
  source={{ kind: "media", media: img, fit: "cover" }}
  colors={["#111111", "#f4f1ea"]}
  effects={[
    { effect: halftone, params: { shape: "dot", size: 16 } },
    { effect: tint, params: { mode: "palette", amount: 0.6 } },
  ]}
  style={{ width: "100%", height: "100%" }}
/>;

Halftone and ASCII draw shapes or characters over the picture; set ground: "paper" to draw them on a flat colour instead. blend and opacity set how any effect mixes with what is below it. A layer with enabled: false is skipped.

Changing effects or their params updates the canvas in place. A new source, seed, background or fontFamily remounts it. The five effect defs (pixelate, dither, halftone, ascii, tint) are re-exported from here, and the repository README lists every param with its range.

Seamless loops

Pass loopSeconds to make the animation repeat exactly, with no visible seam at the wrap:

<Flow colors={colors} loopSeconds={30} style={{ width: "100%", height: "100%" }} />

15 to 60s is the comfortable range, and the period is measured in animation seconds, so it interacts with speed. See the instantshader README for the full details.