Skip to documentation

Image

Glass Pane

An image-backed refractive view with animated glass panels, chromatic aberration, and 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/GlassPane.svelte and installs its dependencies.

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

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

Overview

Glass Pane divides an image into a repeating refractive field with a cubic lens profile, RGB separation, and narrow specular highlights.

Rotation changes the panel field while the optional wave bends and gently animates its boundaries.

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

<section class="relative h-128 overflow-hidden">
	<GlassPane
		class="absolute inset-0"
		src="/images/your-image.jpg"
		refraction={0.15}
		speed={0.8}
	/>

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

<section class="relative h-128 overflow-hidden">
	<GlassPane
		class="absolute inset-0"
		src="/images/your-image.jpg"
		refraction={0.15}
		speed={0.8}
	/>

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

export function Hero() {
	return (
		<section className="relative h-128 overflow-hidden">
			<GlassPane
				className="absolute inset-0"
				src="/images/your-image.jpg"
				refraction={0.15}
				speed={0.8}
			/>

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

export function Hero() {
	return (
		<section className="relative h-128 overflow-hidden">
			<GlassPane
				className="absolute inset-0"
				src="/images/your-image.jpg"
				refraction={0.15}
				speed={0.8}
			/>

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

<template>
	<section class="relative h-128 overflow-hidden">
		<GlassPane
			class="absolute inset-0"
			src="/images/your-image.jpg"
			:refraction="0.15"
			:speed="0.8"
		/>

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

<template>
	<section class="relative h-128 overflow-hidden">
		<GlassPane
			class="absolute inset-0"
			src="/images/your-image.jpg"
			:refraction="0.15"
			:speed="0.8"
		/>

		<div class="relative z-10">Your content</div>
	</section>
</template>
  • Set both Wave frequency and Wave amplitude above zero to reveal the animated panel motion.
  • Use Image fit to preserve the source aspect ratio or deliberately stretch it across the canvas.

Component API

Types below match the selected Svelte component.

Types below match the selected React component.

Types below match the selected Vue component.