Skip to documentation

Background

Dark Current

An animated organic height field shaded with layered color, directional light, and focused specular highlights.

  • pixi.js@^8.20.1

Preparing preview…

Installation

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

Installation unavailable

The preview is public, but its installable release is still being prepared.

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

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

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

Overview

Dark Current layers a recursive animated height function, estimates its surface normal, and shades the result with directional light.

Four palette stops separate recessed areas, the field body, raised color, and focused reflections.

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 DarkCurrent from '$lib/components/ui/DarkCurrent.svelte';
</script>

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

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

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

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

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

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

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

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

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

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

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

		<div class="relative z-10">Your content</div>
	</section>
</template>
  • Keep Distortion below 1 for broad connected forms. Higher values break the surface into smaller turbulent structures.
  • Detail changes frequency growth across all five field layers and can alter the composition substantially.
  • Set Speed to zero for a static frame. Reduced-motion mode pauses the renderer automatically.

Component API

Types below match the selected Svelte component.

Types below match the selected React component.

Types below match the selected Vue component.