Canvas

Lava Lamp

A smooth and organic lava lamp effect using raymarching shaders and SDFs.


Installation

Install the component

Run the following command to install the component and its dependencies:
npx @motion-core/cli add lava-lamp

Import the component

Import the component into your Svelte file:
import { LavaLamp } from "$lib/motion-core";
import { LavaLamp } from "$lib/motion-core";

Usage

Props

1.000
3.000
1.000
0.100
<script lang="ts">
	import { LavaLamp } from "motion-core";
	import type { ComponentProps } from "svelte";

	type Props = Partial<ComponentProps<typeof LavaLamp>>;

	let {
		color = "#17181A",
		fresnelColor = "#ff6900",
		speed = 1,
		fresnelPower = 3,
		radius = 1,
		smoothness = 0.1,
	}: Props = $props();
</script>

<LavaLamp
	class="h-full min-h-96 w-full"
	{color}
	{fresnelColor}
	{speed}
	{fresnelPower}
	{radius}
	{smoothness}
/>

Props

LavaLamp

PropTypeDefault
color
string "#17181A"
fresnelColor
string "#ff6900"
speed
number 1.0
fresnelPower
number 3.0
radius
number 1
smoothness
number 0.1
class
string ""