Presets

Opinionated Fluid wrappers with tuned physics and visuals.

Presets are zero-config wrappers around the core <Fluid> component. Each one pins physics constants, visual settings, and opening splats to produce a specific look. Import a preset and drop it in — no props required.

<script lang="ts">
  import { LavaLamp, Plasma, Aurora } from 'svelte-fluid';
</script>

<LavaLamp />

All presets accept width, height, class, style, seed, lazy, splatOnHover, aria-label, and backColor props for sizing, styling, accessibility, interactive splatting, and adapting the empty-canvas substrate to a host page background. Presets enable splatOnHover by default; pass splatOnHover={false} to disable pointer-driven splats. Flow-scene presets also expose pointerInput.

Each preset below has a Show code action (the wrapper usage plus the full <Fluid> recipe to fork from) and an Open in Playground link that loads the exact configuration into the interactive playground. The prop tables are generated directly from the preset registry, so they always match what the component renders.


LavaLamp

Warm, slow-rising blobs inside a glass rounded-rect vessel on a light-silver background. The blobs never fade and sway with lazy buoyant motion, like real molten wax in a lava lamp.

Container shape: roundedRect (cx: 0.5, cy: 0.5, halfW: 0.38, halfH: 0.45, cornerRadius: 0.15) with glass enabled.

PropValue
containerShaperoundedRect
glasstrue
glassRefraction0.3
glassReflectivity0.08
glassChromatic0.1
curl5
densityDissipation0
initialDensityDissipation0.25
initialDensityDissipationDuration1
velocityDissipation0
pressure0.8
splatRadius0.75
splatForce2200
shadingtrue
colorfulfalse
bloomfalse
sunraysfalse
initialSplatCount0
backColor{ r: 222, g: 218, b: 215 }
presetSplats8 splats

Plasma

A vivid plasma ball with full-spectrum colors converging from all compass directions and churning at the center. Eight inward jets establish a magnetic-pinch convergence zone with intense bloom glow on a near-black backdrop.

Container shape: none (full canvas).

PropValue
curl40
densityDissipation0.12
initialDensityDissipation0.6
initialDensityDissipationDuration2
velocityDissipation0.08
pressure0.8
splatRadius0.35
splatForce5000
shadingtrue
colorfultrue
colorUpdateSpeed8
bloomtrue
bloomThreshold0.6
bloomIntensity1.5
sunraystrue
sunraysWeight0.5
initialSplatCount0
backColor{ r: 4, g: 2, b: 12 }
presetSplats8 splats
autoSplatRate0.4
autoSplatCount4
autoSplatEvenXfalse
autoSplatCenterY0.5

InkInWater

Concentrated ink droplets sinking through dark water, blooming outward as they fall. Modeled after india ink in a deep tank with organic tendrils from gentle Rayleigh-Taylor instability.

Container shape: none (full canvas).

PropValue
curl8
densityDissipation0.3
velocityDissipation0.15
pressure0.85
splatRadius0.12
splatForce800
shadingtrue
colorfulfalse
bloomtrue
bloomIntensity0.6
bloomThreshold0.4
sunraysfalse
autoSplatRate0.2
autoSplatColorsee code
autoSplatVelocityX0
autoSplatVelocityY-180
autoSplatCenterY0.9
initialSplatCount0
backColor{ r: 6, g: 8, b: 20 }
presetSplats5 splats

FrozenSwirl

A single dramatic icy whirlpool in a circular vessel that spins itself out and comes to rest. High velocity dissipation freezes the motion fast, leaving a permanent crystalline curl on a deep navy backdrop.

Container shape: circle (cx: 0.5, cy: 0.5, radius: 0.45).

PropValue
containerShapecircle
curl50
densityDissipation0
velocityDissipation1
pressure0.95
splatRadius0.5
splatForce8000
shadingtrue
colorfulfalse
bloomtrue
bloomIntensity1
sunraysfalse
initialSplatCount0
backColor{ r: 4, g: 8, b: 24 }
presetSplats3 splats

Aurora

Northern lights — green, magenta, and pale-blue ribbons layered across a deep night sky. The opening bands have a sideways push, then settle into a luminous steady wash while heavy bloom and sunrays grow the atmospheric glow over time.

Container shape: none (full canvas).

PropValue
curl40
densityDissipation0
velocityDissipation0.3
pressure0.85
splatRadius0.4
splatForce6000
shadingtrue
colorfulfalse
bloomtrue
bloomIntensity1.5
sunraystrue
sunraysWeight1.4
initialSplatCount0
backColor{ r: 2, g: 4, b: 18 }
presetSplats5 splats

Toroidal

A violent full-spectrum storm circulating in a toroidal ring. Eight high-velocity dye blobs orbit inside an annular container with fierce counter-clockwise flow. Periodic re-injection every 2 seconds keeps the ring fed with fresh color.

Container shape: annulus (cx: 0.5, cy: 0.5, innerRadius: 0.15, outerRadius: 0.42).

PropValue
containerShapeannulus
curl50
densityDissipation0.25
initialDensityDissipation0.6
initialDensityDissipationDuration2
velocityDissipation0.02
pressure0.8
splatRadius0.4
splatForce6000
shadingtrue
colorfultrue
colorUpdateSpeed8
bloomtrue
bloomThreshold0.5
bloomIntensity1.8
sunraystrue
sunraysWeight0.6
initialSplatCount0
backColor{ r: 2, g: 2, b: 10 }
presetSplats8 splats

CircularFluid

Vivid swirling fluid contained inside a circle. Eight inward jets converge from the compass points, and the circular boundary reflects them back inward to produce a self-sustaining vortex. Automatic splats with orbital swirl sustain the motion.

Container shape: circle (cx: 0.5, cy: 0.5, radius: 0.45).

PropValue
containerShapecircle
curl35
densityDissipation0.15
initialDensityDissipation0.5
initialDensityDissipationDuration2
velocityDissipation0.06
pressure0.8
splatRadius0.38
splatForce5000
shadingtrue
colorfultrue
colorUpdateSpeed8
bloomtrue
bloomThreshold0.6
bloomIntensity1
sunraysfalse
initialSplatCount0
backColor{ r: 4, g: 2, b: 12 }
presetSplats8 splats
autoSplatRate1.2
autoSplatCount1
autoSplatCenterY0.5
autoSplatBandHeight0.8
autoSplatSwirl500

FrameFluid

Fluid swirling around a rectangular inner cutout, like a living picture frame. Four edge jets create clockwise circulation and four diagonal jets add turbulence at the corners. Accepts optional innerCornerRadius and outerCornerRadius props.

Container shape: frame (cx: 0.5, cy: 0.5, halfW: 0.25, halfH: 0.25).

PropValue
containerShapeframe
curl30
densityDissipation0.08
initialDensityDissipation0.5
initialDensityDissipationDuration2
velocityDissipation0.06
pressure0.8
splatRadius0.42
splatForce5000
shadingtrue
colorfultrue
colorUpdateSpeed8
bloomtrue
bloomThreshold0.6
bloomIntensity0.9
sunraysfalse
initialSplatCount0
backColor{ r: 0, g: 0, b: 0 }
presetSplats8 splats
autoSplatRate0.5
autoSplatCount6
autoSplatCenterY0.5
autoSplatBandHeight2
autoSplatSwirl300

AnnularFluid

A ring-vortex of fluid contained between two concentric circles. Eight tangential jets establish a counter-clockwise ring vortex. Automatic splats with orbital swirl sustain the motion.

Container shape: annulus (cx: 0.5, cy: 0.5, innerRadius: 0.15, outerRadius: 0.45).

PropValue
containerShapeannulus
curl35
densityDissipation0.08
initialDensityDissipation0.5
initialDensityDissipationDuration2
velocityDissipation0.06
pressure0.8
splatRadius0.38
splatForce5000
shadingtrue
colorfultrue
colorUpdateSpeed8
bloomtrue
bloomThreshold0.6
bloomIntensity1
sunraysfalse
initialSplatCount0
backColor{ r: 4, g: 2, b: 12 }
presetSplats8 splats
autoSplatRate0.5
autoSplatCount5
autoSplatCenterY0.5
autoSplatBandHeight0.8
autoSplatSwirl600

SvgPathFluid

Fluid flowing inside a bold ampersand "&" glyph, demonstrating text-mode container shapes. The letter is rasterized to a mask texture via Canvas 2D fillText, with evenodd fill rule so the counter (hole) in the glyph stays transparent.

Container shape: svgPath (text: "&", font: "bold 200px Georgia, serif", fillRule: "evenodd").

PropValue
containerShapesvgPath
curl30
densityDissipation0.3
velocityDissipation0.1
pressure0.8
splatRadius0.3
splatForce5000
shadingtrue
colorfultrue
bloomtrue
bloomIntensity0.9
sunraysfalse
initialSplatCount8
backColor{ r: 2, g: 2, b: 8 }
autoSplatRate0.8
autoSplatCount1
autoSplatBandHeight2
autoSplatSwirl400

GasFlare

A natural-gas flare plume from a short exit nozzle. A hot vertical jet enters through a physical slot, entrains surrounding fluid, rolls into shear-layer vortices, and rises under temperature-scalar buoyancy with a fire transfer ramp.

Obstructions: two lower slabs form the left and right walls of a flare stack, leaving a center nozzle slot open. The top and side edges drain the plume so hot content can vent instead of saturating the canvas.

Honest physics note: this is an incompressible jet/plume simulation with advected heat scalar and buoyancy. It does not model combustion chemistry, compressibility, soot, radiation, or heat release.

PropValue
obstructions2 obstructions
flowFlowConfig — see code
openBoundarytrue
curl16
densityDissipation0.42
initialDensityDissipation0.55
velocityDissipation0.055
pressure0.85
pressureIterations24
splatRadius0.06
splatForce3800
shadingfalse
colorfulfalse
bloomtrue
bloomIterations5
bloomResolution192
bloomThreshold0.48
bloomIntensity1
sunraysfalse
sunraysWeight0
simResolution160
dyeResolution768
initialSplatCount0
backColor{ r: 6, g: 6, b: 8 }

Venturi

Bernoulli's principle made visible. A gentle left-to-right body force acts like a pressure gradient, pushing fluid through a wide channel that is squeezed through a central throat formed by two concave obstruction islands. The visualization colors the velocity-magnitude field with a CFD-style blue→cyan→green→yellow→red ramp so the throat acceleration is readable instead of appearing as a uniform center jet.

Obstructions: two concave islands (top + bottom) pinching a horizontal channel from a wide inlet to a ~5.3:1 contraction at the throat. Open left/right boundaries let the inlet feed throughflow while the solid obstruction mask forms the throat; laminar (curl 0) so the streamlines stay ordered.

Honest physics note: the throat speed-up is an incompressible, low-speed effect and belongs in the live solver. Pressure/density changes from compressible gas flow are not modeled.

PropValue
obstructions2 obstructions
flowFlowConfig — see code
openBoundarytrue
curl0
densityDissipation0.35
velocityDissipation0.09
maxTimeStep0.016666666666666666
substeps1
viscosity0.016
viscosityIterations5
wallFriction0.16
wallFrictionWidth2
pressure0.9
pressureIterations26
splatRadius0.055
splatForce6000
shadingfalse
colorfulfalse
bloomfalse
bloomThreshold0.6
bloomIntensity0.5
sunraysfalse
simResolution160
dyeResolution512
initialSplatCount0
backColor{ r: 6, g: 10, b: 14 }

Karman

Flow past a single cylinder, evocative of a von Kármán vortex street — the alternating wake of vortices shed behind a bluff body in steady cross-flow. A pressure-gradient body force drives the field left to right while a rake of six persistent dye-only streakline sources (one hue each — the classic wind-tunnel smoke-rake, passively riding the flow) feeds continuous colored filaments through the wake. The cylinder is painted via obstructionColor so the bluff body reads as a visible object.

Obstruction: a single cylinder (circle authored as two SVG arcs, radius 10 in a [0,0,100,100] viewBox, fit: 'fill') placed left of center and slightly below the inflow centerline — the deliberate vertical offset breaks symmetry so the wake sheds instead of forming a stable standing pair. All canvas edges are open with dye sponge drains; only the downstream outlet damps velocity.

Honest physics note: this is evocative of a vortex street, not a validated shedding simulation. The cylinder is a rasterized mask, shedding emerges from shear layers rolling up behind the disc, and its frequency is not a real Strouhal number.

PropValue
obstructions1 obstruction
obstructionColor{ r: 86, g: 98, b: 122 }
flowFlowConfig — see code
openBoundarytrue
curl10
densityDissipation0.7
velocityDissipation0.075
maxTimeStep0.008333333333333333
substeps2
viscosity0.014
viscosityIterations8
wallFriction0.16
wallFrictionWidth2
pressure0.9
pressureIterations34
splatRadius0.06
splatForce6000
shadingfalse
colorfulfalse
bloomfalse
sunraysfalse
simResolution192
dyeResolution1024
initialSplatCount0
presetSplats5 splats
backColor{ r: 4, g: 6, b: 14 }

TeslaValve

A passive Tesla-valve-like channel with a straight conduit and patent-style alternating bypass loops. A pressure-gradient drive carries discrete multicolor left-edge splats through a high-viscosity channel, making dye packets and side-bucket recirculation easier to inspect; forward throughflow is expected.

Geometry: a cropped reference SVG path defines the conduit, side-channel buckets, and internal slots as one even-odd container mask. The filled SVG region is the physical fluid domain, so the slots and walls are solved as part of the same boundary.

Honest physics note: this is a live incompressible throughflow visualization, not a hard-stop check valve. It gives plausible routing, separation, and recirculation cues, but it does not calculate a reverse/forward pressure-drop ratio or real valve rectification.

PropValue
containerShapesvgPath
flowFlowConfig — see code
curl10
densityDissipation0.36
velocityDissipation0.085
maxTimeStep0.016666666666666666
substeps1
viscosity0.04
viscosityIterations10
wallFriction0.14
wallFrictionWidth2
pressure0.9
pressureIterations30
splatRadius0.085
splatForce6000
autoSplatRate5
autoSplatCount4
autoSplatVelocityX190
autoSplatVelocityY0
autoSplatCenterX0.035
autoSplatBandWidth0.024
autoSplatCenterY0.49
autoSplatBandHeight0.18
shadingfalse
colorfulfalse
bloomfalse
sunraysfalse
simResolution192
dyeResolution768
initialSplatCount0
backColor{ r: 5, g: 9, b: 12 }

Overriding Preset Props

Presets hard-code their physics and visual props internally. However, each preset forwards sizing props (width, height), styling props (class, style), seed, lazy, splatOnHover, aria-label, and backColor directly to the underlying <Fluid> component. Flow-scene presets also forward pointerInput.

If you need to override a pinned physics prop, you have two options:

  • Use the base <Fluid> component directly and copy the preset's prop values as a starting point — the Show code action above gives you the full recipe to paste.
  • Fork the preset source file into your own component — preset source is short (typically under 100 lines) and self-contained.

Some presets expose additional props beyond the common set. For example, <FrameFluid> accepts innerCornerRadius and outerCornerRadius. Check the preset's exported type for the full list.