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

react-native-skia-shaders

v0.1.0

Published

Paper Shaders ported to SkSL for React Native Skia: mesh gradients and friends on iOS, Android, and web.

Readme

react-native-skia-shaders

Paper Shaders ported to SkSL for React Native Skia. Same props, same presets, same look, but rendered on iOS, Android, and web (via CanvasKit) instead of a DOM <canvas>.

Install

npm install react-native-skia-shaders @shopify/react-native-skia react-native-reanimated

Skia and Reanimated are peer dependencies. Follow their install guides for the native setup (Expo: npx expo install @shopify/react-native-skia react-native-reanimated).

Usage

import { MeshGradient } from 'react-native-skia-shaders';

<MeshGradient
  style={{ width: '100%', height: 240 }}
  colors={['#e0eaff', '#241d9a', '#f75092', '#9f50d3']}
  distortion={0.8}
  swirl={0.1}
  speed={1}
/>

Children render on top of the shader, so it works as a background:

<MeshGradient style={styles.hero} {...meshGradientPresets[3].params}>
  <Text>Saturday dinner</Text>
</MeshGradient>

Props

Every shader accepts the upstream sizing props (fit, scale, rotation, originX, originY, offsetX, offsetY, worldWidth, worldHeight) and motion props (speed, frame). speed={0} freezes the shader. World sizes are in points, not device pixels.

MeshGradient adds colors (up to 10, any CSS hex/rgb/hsl string), distortion, swirl, grainMixer, and grainOverlay, all 0..1.

GrainGradient adds colorBack, colors (up to 7), softness, intensity, noise (all 0..1) and shape: wave, dots, truchet, corners, ripple, blob, or sphere. Presets are exported as grainGradientPresets.

Lower-level API

The SkSL source and a uniform builder are exported for each shader, so you can drop the effect into your own Skia tree, for example behind an ImageShader mask or inside a Group with a clip:

import { Shader, Fill } from '@shopify/react-native-skia';
import { compileEffect, meshGradientSkSL, meshGradientUniforms } from 'react-native-skia-shaders';

const effect = compileEffect(meshGradientSkSL);
const uniforms = { ...meshGradientUniforms(params, [width, height]), u_time: seconds };

<Fill><Shader source={effect} uniforms={uniforms} /></Fill>

Shaders

| Upstream | Status | | --- | --- | | Mesh Gradient | ported | | Grain Gradient | ported (all seven shapes) | | Everything else | not yet |

Porting a shader means translating its fragment shader to SkSL (mostly mechanical: no #version, no precision, main(vec2) returns premultiplied vec4, sizing math moves from the vertex stage into getObjectUV) and adding a uniform builder plus presets. Shaders that sample a noise texture take the bundled image as an ImageShader child (see GrainGradient). SkSL has no fwidth, so derivative-based anti-aliasing becomes a fixed epsilon.

Example app

example/ is an Expo app that imports the library from ../src:

cd example && npm install && npm run web   # or ios / android

On web, Skia binds CanvasKit at import time, so the demo is loaded through WithSkiaWeb (see example/App.web.tsx) and nothing imports the library before that resolves.

Development

npm install
npm run typecheck
npm test          # compiles the SkSL with CanvasKit and renders each preset to test/__output__
npm run build

Tests run the real Skia compiler (CanvasKit wasm) in Node, so a shader that does not compile fails CI, and every preset produces a PNG you can eyeball against shaders.paper.design.

License

Apache-2.0. This is a derivative work of Paper Shaders by Paper Design, also Apache-2.0; see NOTICE.