Creates a reflective floor below the input and shows a flipped reflection of its content.
Also known as: ReflectivePlaneMirror floorReflection plane
Moves in browsers that support WebGPU
This device could not render the demo — showing a still
Code reflects the control values
React
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, ImageTexture, ReflectivePlane } from 'shaders/react'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: 320 }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/photo.jpg" />
<ReflectivePlane />
</Shader>
)
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<!-- /samples/… are this site’s sample files — point them at your own image or video. -->
<script setup lang="ts">
import { Shader, ImageTexture, ReflectivePlane } from 'shaders/vue'
</script>
<template>
<Shader style="width: 100%; height: 320px" :disable-telemetry="true">
<ImageTexture
object-fit="cover"
url="/samples/photo.jpg"/>
<ReflectivePlane/>
</Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<!-- /samples/… are this site’s sample files — point them at your own image or video. -->
<script>
import { Shader, ImageTexture, ReflectivePlane } from 'shaders/svelte'
</script>
<Shader style="width: 100%; height: 320px" disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/photo.jpg" />
<ReflectivePlane />
</Shader>
Solid
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, ImageTexture, ReflectivePlane } from 'shaders/solid'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/photo.jpg" />
<ReflectivePlane />
</Shader>
)
}
JavaScript
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
// expects <canvas id="canvas" style="width:100%;height:320px"></canvas> on the page
import { createShader } from 'shaders/js'
const shader = await createShader(document.getElementById("canvas"), {
components: [
{
type: 'ImageTexture',
props: {
objectFit: 'cover',
url: '/samples/photo.jpg',
},
},
{
type: 'ReflectivePlane',
}
]
}, { disableTelemetry: true })
Props · ReflectivePlane
Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).
Name
Value
Default
Range / options
Description
heightFloor Height
0.7
0 – 1 (step 0.01)
Vertical position of the reflective surface
distanceReflection Distance
0.5
0.01 – 1 (step 0.01)
How far below the floor the reflection remains visible before fully fading to transparent.
falloffReflection Falloff
0.5
0 – 3 (step 0.01)
Width of the fade zone, as a fraction of reflection distance.
blurBlur
3
0 – 5 (step 0.01)
Maximum blur applied to the reflection far from the surface.
blurDistanceBlur Distance
0.3
0.01 – 1 (step 0.01)
How far below the surface the blur takes to ramp from sharp to maximum.
edgesEdges
stretch
stretch · transparent · mirror · wrap
How to handle reflected samples that fall outside the source content.
Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id
A mirror image continues beneath the subject as if it were standing on a polished floor. The reflection is clearest near the surface and softens farther away.
`height` defaults to 0.7 (range 0–1) and sets the floor's vertical position. `distance` defaults to 0.5 (0.01–1) sets how far the reflection remains visible; `falloff` defaults to 0.5 (0–3) controls how much of that distance is used for its fade. `blur` defaults to 3 (0–5) sets the maximum reflection blur, while `blurDistance` defaults to 0.3 (0.01–1) sets how far from the surface that blur ramps up.
Apply it to a subject with transparent space around it or content on a simple background so the floor and reflection read clearly. A drop shadow can help ground the subject, but a busy full-frame pattern may make the reflection distracting.
When to use
Use it to place a product, logo, or typography above a reflective floor, or add depth to a simple hero scene. Avoid it for small UI or dense photographs.