Skip to content

Installation

All packages are ESM-only and marked sideEffects: false, so bundlers tree-shake every engine you don’t import. Works with pnpm, npm, yarn, or bun — examples use pnpm.

Path Packages
React app @shadekit/react + @shadekit/shaders
Everything else @shadekit/element + @shadekit/shaders
Your own wrapper / direct canvas control @shadekit/core + @shadekit/shaders

@shadekit/element and @shadekit/react already depend on @shadekit/core — installing them pulls the engine transitively. Dedicated wrappers other than React aren’t shipped yet; the <sk-shader> custom element covers every framework that renders standard DOM elements.

Terminal window
pnpm add @shadekit/react @shadekit/shaders
import { Shader } from '@shadekit/react';
import { aurora } from '@shadekit/shaders/aurora';
export function Hero() {
return (
<div style={{ height: '20rem' }}>
<Shader shader={aurora} uniforms={{ speed: 0.4 }} pointer />
</div>
);
}

uniforms is reactive — a new object updates in place without remounting. Full props: @shadekit/react.

Next.js App Router: add 'use client' to the file using <Shader> (it uses hooks). SSR is safe — the instance mounts in useEffect, so nothing renders on the server.

<sk-shader> renders a canvas stretched to 100% × 100% of the element — the element itself must have a height. Give it a class or wrapper; don’t use the style attribute for sizing (it carries the preset name):

<div style="height: 24rem">
<sk-shader style="aurora-ember"></sk-shader>
</div>
/* or a utility class */
.shader-block { display: block; height: 24rem; }

customElements only exists in the browser. Under SSR (Next, Nuxt, SvelteKit, SolidStart, Qwik) register inside the framework’s client-only hook — useEffect, onMount, useVisibleTask$ — as shown in the tabs. The <sk-shader> tag itself renders harmlessly as an empty element on the server and upgrades on hydration.

  • A browser with WebGPU or WebGL2 — backend: 'auto' (the default) prefers WebGPU and falls back automatically. See Backends.
  • TypeScript types ship with every package.