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

@scribehow/shaders

v2.0.0

Published

WebGL shaders used across various Scribe surfaces on web.

Readme

Scribe Shaders

A collection of interactive WebGL shaders used at Scribe.

Shaders are built with OGL—a lightweight WebGL Library—and Tweakpane, dev tool for fine-tuning parameters.

Installation

npm install @scribehow/shaders
# or
yarn add @scribehow/shaders

Usage

Basic Usage

import { FluidLight } from '@scribehow/shaders';

const canvas = document.getElementById('canvas');

if (canvas) {
  const shader = await FluidLight.create(canvas, {
    // Config options
  });
}

React Usage

import { useRef, useEffect, useState } from 'react';
import { FluidLight, type FluidLightShader } from '@scribehow/shaders';

export const FluidLightBackground = () => {
  const canvasRef = useRef<HTMLCanvasElement>(null);

  useEffect(() => {
    if (!canvasRef.current) return;

    await FluidLight.create(canvasRef.current, {
      // Config options
    });
  }, [canvasRef]);

  return <canvas ref={canvasRef} className='size-full'></canvas>
}

Script Tag

For usage without a bundler, the package provides a global build, with methods accessed through the global ScribeShaders namespace:

<script src="https://cdn.jsdelivr.net/npm/@scribehow/shaders@latest/dist/browser/index.global.js"></script>
<script>
  const canvas = document.getElementById('canvas');

  if (canvas && typeof ScribeShaders !== 'undefined') {
    // Create shader using the `ScribeShaders` global namespace
    ScribeShaders.FluidLight.create(canvas, {
      // Config options
    }).then(shader => {
      console.log('Shader created!');
    });
  }
</script>

Development Tools (Optional)

The package includes optional development tools powered by Tweakpane for real-time parameter adjustment. These tools are not bundled unless you explicitly enable them and install the required dependencies.

Installing Development Dependencies

If you want to use the development tools, install the optional peer dependencies:

npm install tweakpane @tweakpane/plugin-essentials
# or
yarn add tweakpane @tweakpane/plugin-essentials

Enabling Development Tools

import { FluidLight } from '@scribehow/shaders';

const canvas = document.getElementById('canvas');

if (canvas) {
  const shader = await FluidLight.create(canvas, {
    // Config options
  });

  await FluidLight.attachDevtools(shader);
}

Note: If you haven't installed the Tweakpane dependencies, the attachDevtools call will fail gracefully.

API Reference

FluidLight

View Preview

FluidLight.create(canvas, config?)

Creates a new FluidLight shader instance.

Parameters:

  • canvas (HTMLCanvasElement): The canvas element to render to
  • config (Partial<FluidLightConfig>, optional): Configuration options

Returns: Promise<FluidLightShader>

FluidLight.attachDevtools(shader)

Parameters:

  • shader (FluidLightShader): The shader instance to attach devtools to

Returns: Promise<DevtoolsInstance>

FluidLightConfig

The second argument passed into FluidLight.create() is FluidLightConfig — an object which allows adjusting the colors, movement, distortion, and other effects of the shader. The default settings are below.

await FluidLight.create(canvas, {
  // Side to orient effects around
  // 0 = bottom, 1 = top, 2 = right, 3 = left
  side: 0,                 

  // Background color
  background: "#020617",

  // Light wave configuration
  lightWave: {
    amplitude: 0.04,      // Wave height/intensity
    speed: 0.4,           // Animation speed
    frequency: 1.2,       // Wave frequency/density
    color1: "#5648FB",    // Outermost color
    color2: "#3AC3FF",    // Second color
    color3: "#CE7FFF",    // Third color
    color4: "#F45397",    // Fourth color
    color5: "#FFB525",    // Center color
    minFalloff: 6.0,      // Minimum falloff intensity
    maxFalloff: 8.0,      // Maximum falloff intensity
  },

  // Echo / ripple effect configuration
  echo: {                  
    enabled: true,
    offset: 0.1,          // Distance from edge
    radius: 0.9,          // Initial radius
    frequency: 20.0,      // Ripple frequency
    ringSize: 2.0,        // Ring thickness
    strokeOpacity: 0.2,   // Ring stroke opacity
    fillOpacity: 0.01,    // Ring fill opacity
    animateIn: true,      // Animate entrance
    animationDuration: 3000,  // Animation duration (ms)
    animationDelay: 200,  // Animation delay (ms)
  },
});