Skip to documentation

Components

Liquid Metal

Fluid metallic folds with soft refraction, chromatic separation, and a polished moving surface.

  • 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/LiquidMetal.svelte and installs its dependencies.

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

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

PixiJS is included as a registry dependency and is installed by the same command.

The generated component contains both WGSL and GLSL so WebGPU can fall back to WebGL.

Overview

Liquid Metal turns layered procedural distortion into a reflective surface that feels fluid without relying on textures or external assets.

It works best as a visual layer inside a deliberately sized container: a hero background, campaign surface, transition, or immersive product section.

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

<section class="relative h-128 overflow-hidden">
	<LiquidMetal
		class="absolute inset-0"
		color="#FFFFFF"
		speed={0.8}
		refraction={2}
	/>

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

<section class="relative h-128 overflow-hidden">
	<LiquidMetal
		class="absolute inset-0"
		color="#FFFFFF"
		speed={0.8}
		refraction={2}
	/>

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

export function Hero() {
	return (
		<section className="relative h-128 overflow-hidden">
			<LiquidMetal
				className="absolute inset-0"
				color="#FFFFFF"
				speed={0.8}
				refraction={2}
			/>

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

export function Hero() {
	return (
		<section className="relative h-128 overflow-hidden">
			<LiquidMetal
				className="absolute inset-0"
				color="#FFFFFF"
				speed={0.8}
				refraction={2}
			/>

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

<template>
	<section class="relative h-128 overflow-hidden">
		<LiquidMetal
			class="absolute inset-0"
			color="#FFFFFF"
			:speed="0.8"
			:refraction="2"
		/>

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

<template>
	<section class="relative h-128 overflow-hidden">
		<LiquidMetal
			class="absolute inset-0"
			color="#FFFFFF"
			:speed="0.8"
			:refraction="2"
		/>

		<div class="relative z-10">Your content</div>
	</section>
</template>
  • Give the component or its parent an explicit height; the shader always fills that parent and never claims the viewport itself.
  • Place readable foreground content in a later stacking layer and keep contrast independent from the brightest part of the animation.

Component API

Types below match the selected Svelte component.

Property Type Default Range / values
class
string
color
string "#FFFFFF"
backgroundColor
string "#17181A"
speed
number 1 0–2
scale
number 1 0.35–2.5
frequency
number 3.5 1–8
refraction
number 2 0–5
chromaticAberration
number 3 0–8
blur
number 1 0–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
color
string "#FFFFFF"
backgroundColor
string "#17181A"
speed
number 1 0–2
scale
number 1 0.35–2.5
frequency
number 3.5 1–8
refraction
number 2 0–5
chromaticAberration
number 3 0–8
blur
number 1 0–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
LiquidMetalHandle pause, resume, reset, resize, destroy

Types below match the selected Vue component.

Property Type Default Range / values
class
string
color
string "#FFFFFF"
backgroundColor
string "#17181A"
speed
number 1 0–2
scale
number 1 0.35–2.5
frequency
number 3.5 1–8
refraction
number 2 0–5
chromaticAberration
number 3 0–8
blur
number 1 0–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