Skip to documentation

Components

Dithered Wave

An organic animated plasma field reduced to a four-step palette through resolution-stable Bayer dithering.

  • pixi.js@^8.20.1

Preparing preview…

Installation

Choose your framework. The registry installs one component file and its PixiJS dependency.

Installation unavailable

This preview is not assigned to the free or paid catalog. Installation is unavailable.

The registry command writes the component to src/lib/components/ui/DitheredWave.svelte and installs its dependencies.

The registry command writes the component to src/components/ui/DitheredWave.tsx and installs its dependencies.

The registry command writes the component to src/components/ui/DitheredWave.vue and installs its dependencies.

The Bayer matrix is embedded directly in both shader backends, so no lookup texture is required.

The source field and quantization run in one fragment pass.

Overview

Dithered Wave combines several domain-warped sine and radial waves into an organic full-canvas plasma field, samples it on a square pixel grid, then applies a 4 by 4 Bayer threshold before reducing it to four palette levels.

Separating the continuous plasma from the ordered post-process keeps the motion fluid while retaining a deliberate low-resolution surface.

Basic usage

The shader fills its parent. Your layout decides whether that parent is a card, hero, or viewport.

Hero.svelte
<script lang="ts">
	import DitheredWave from '$lib/components/ui/DitheredWave.svelte';
</script>

<section class="relative h-128 overflow-hidden">
	<DitheredWave
		class="absolute inset-0"
		speed={0.8}
	/>

	<div class="relative z-10">Your content</div>
</section>
<script lang="ts">
	import DitheredWave from '$lib/components/ui/DitheredWave.svelte';
</script>

<section class="relative h-128 overflow-hidden">
	<DitheredWave
		class="absolute inset-0"
		speed={0.8}
	/>

	<div class="relative z-10">Your content</div>
</section>
import { DitheredWave } from '@/components/ui/DitheredWave';

export function Hero() {
	return (
		<section className="relative h-128 overflow-hidden">
			<DitheredWave
				className="absolute inset-0"
				speed={0.8}
			/>

			<div className="relative z-10">Your content</div>
		</section>
	);
}
import { DitheredWave } from '@/components/ui/DitheredWave';

export function Hero() {
	return (
		<section className="relative h-128 overflow-hidden">
			<DitheredWave
				className="absolute inset-0"
				speed={0.8}
			/>

			<div className="relative z-10">Your content</div>
		</section>
	);
}
<script setup lang="ts">
import DitheredWave from '@/components/ui/DitheredWave.vue';
</script>

<template>
	<section class="relative h-128 overflow-hidden">
		<DitheredWave
			class="absolute inset-0"
			:speed="0.8"
		/>

		<div class="relative z-10">Your content</div>
	</section>
</template>
<script setup lang="ts">
import DitheredWave from '@/components/ui/DitheredWave.vue';
</script>

<template>
	<section class="relative h-128 overflow-hidden">
		<DitheredWave
			class="absolute inset-0"
			:speed="0.8"
		/>

		<div class="relative z-10">Your content</div>
	</section>
</template>
  • Set Dither strength to zero to keep the palette quantization without the ordered threshold pattern.
  • Pixel size is defined in canvas pixels and can be enlarged for a more graphic texture.

Component API

Types below match the selected Svelte component.

Property Type Default Range / values
class
string
darkColor
string "#131315"
brandColor
string "#5867D3"
highlightColor
string "#D9DCFF"
speed
number 0.8 0–2
pixelSize
number 8 1–12
ditherStrength
number 1 0–2
fieldScale
number 2.5 0.4–2.5
warp
number 2.5 0–2.5
detail
number 1 0.4–2.5
paused
boolean false
interactive
boolean false
maxDpr
number 2 1–3
resolutionScale
number 1 0.25–1
onReady
(backend: ShaderBackend) => void webgpu, webgl
onRendererChange
(backend: ShaderBackend, reason: string) => void webgl
onError
(error: Error) => void
bind:this
Component public instance pause, resume, reset, resize, destroy

Types below match the selected React component.

Property Type Default Range / values
className
string
darkColor
string "#131315"
brandColor
string "#5867D3"
highlightColor
string "#D9DCFF"
speed
number 0.8 0–2
pixelSize
number 8 1–12
ditherStrength
number 1 0–2
fieldScale
number 2.5 0.4–2.5
warp
number 2.5 0–2.5
detail
number 1 0.4–2.5
paused
boolean false
interactive
boolean false
maxDpr
number 2 1–3
resolutionScale
number 1 0.25–1
onReady
(backend: ShaderBackend) => void webgpu, webgl
onRendererChange
(backend: ShaderBackend, reason: string) => void webgl
onError
(error: Error) => void
ref
DitheredWaveHandle pause, resume, reset, resize, destroy

Types below match the selected Vue component.

Property Type Default Range / values
class
string
darkColor
string "#131315"
brandColor
string "#5867D3"
highlightColor
string "#D9DCFF"
speed
number 0.8 0–2
pixelSize
number 8 1–12
ditherStrength
number 1 0–2
fieldScale
number 2.5 0.4–2.5
warp
number 2.5 0–2.5
detail
number 1 0.4–2.5
paused
boolean false
interactive
boolean false
maxDpr
number 2 1–3
resolutionScale
number 1 0.25–1
@ready
(backend: ShaderBackend) => void webgpu, webgl
@rendererchange
(backend: ShaderBackend, reason: string) => void webgl
@error
(error: Error) => void
ref
Component public instance pause, resume, reset, resize, destroy