Liquid fill
A glass tank filling with rippling liquid up to its percent cap; the wave beats on two same-frequency layers out of phase — the back one paler, shifted half a wavelength. The number counts with the liquid and at the end a ready label rises out of the tank; its little sister shows the disk-full failure frozen mid-fill.
Real scenarios
The component as it is used in a product — not a specimen grid.
A tank that tells you how full you are
The migration tank of a cloud move: two same-frequency waves run out of phase — the back one paler, half a wavelength behind — while the level climbs and the number counts with it. At the top the number yields to a tick and the ready label rises out of the liquid.
Atlas · cloud migration
The tank that froze mid-fill
The nightly backup tank stopped at 34%: the destination disk ran full, the waves halted and the liquid turned grey. Retry frees the space and the same tank runs on to green.
Nightly backup · Dublin vault
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| fill | % | '0 → 100' | The liquid level rises through one vertical translate; a circular clipPath keeps it inside the tank. |
| waves | layers | '2' | Two same-frequency layers half a wavelength out of phase; the back one pale and shallow, the front gradient-filled — depth for free. |
| drift | s | '3.2' | A seamless horizontal drift of exactly one wavelength; the path spans 400 units so no seam ever shows. |
| amplitude | px | '9 · 6' | Front and back wave amplitudes; the centre number recolours the moment the liquid reaches it, so it stays readable. |
| ready | state | 'label' | At 100% the number yields to a tick and the ready label; on error the wave stops and the liquid turns grey. |
Snippet
<div class="ldl-tank" style="--ldl-level: 118px">
<svg viewBox="0 0 200 200" aria-hidden="true">
<defs>
<clipPath id="ldl-clip"><circle cx="100" cy="100" r="88"/></clipPath>
</defs>
<circle class="ldl-glass" cx="100" cy="100" r="88"/>
<g clip-path="url(#ldl-clip)">
<g class="ldl-level">
<path class="ldl-wave ldl-wave-b" d="M0 0 Q25 -6 50 0 T100 0 T150 0 T200 0 T250 0 T300 0 T350 0 T400 0 V220 H0 Z"/>
<path class="ldl-wave ldl-wave-f" d="M0 0 Q25 -9 50 0 T100 0 T150 0 T200 0 T250 0 T300 0 T350 0 T400 0 V220 H0 Z"/>
</g>
</g>
<circle class="ldl-rim" cx="100" cy="100" r="88"/>
</svg>
<b>42%</b>
</div>
<style>
.ldl-tank { position: relative; display: grid; place-items: center; inline-size: 10rem; aspect-ratio: 1;
font: 700 1.5rem/1 'Inter', 'Vazirmatn', sans-serif; }
.ldl-tank svg { position: absolute; inset: 0; }
.ldl-glass, .ldl-rim { fill: none; }
.ldl-glass { stroke: #e7e5e4; stroke-width: 3; }
.ldl-rim { stroke: #d6d3d1; stroke-width: 1.5; }
.ldl-level { translate: 0 var(--ldl-level); }
.ldl-wave { animation: ldl-drift 3.2s linear infinite; }
.ldl-wave-b { fill: #99f6e4; opacity: .55; animation-delay: -1.6s; }
.ldl-wave-f { fill: #0d9488; }
@keyframes ldl-drift { to { translate: -100px 0; } }
@media (prefers-reduced-motion: reduce) { .ldl-wave { animation: none; } }
</style>
// app/Pages/Migration.jsx — Inertia (React) page; renders the React
// snippet below unchanged, with Inertia's Link in the provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import MigrationTank from '@/components/MigrationTank';
export default function Migration() {
return (
<NabuXUIProvider locale="en" linkComponent={Link}>
<main className="nx-page">
<MigrationTank workMs={5200} />
</main>
</NabuXUIProvider>
);
}
// MigrationTank.jsx — a liquid tank that fills to its ready label
import { useEffect, useRef, useState } from 'react';
import '@nabuxai/ui-core/css';
const WAVE_B = 'M0 0 Q25 -6 50 0 T100 0 T150 0 T200 0 T250 0 T300 0 T350 0 T400 0 V220 H0 Z';
const WAVE_F = 'M0 0 Q25 -9 50 0 T100 0 T150 0 T200 0 T250 0 T300 0 T350 0 T400 0 V220 H0 Z';
export default function MigrationTank({ workMs = 5200 }) {
const [state, setState] = useState('working'); // working | done
const [p, setP] = useState(0);
const raf = useRef(0);
// Unmount aborts the frame loop — no tank fills behind the page.
useEffect(() => () => cancelAnimationFrame(raf.current), []);
const run = () => {
if (state === 'working') return;
setState('working');
setP(0);
const t0 = performance.now();
const tick = (now) => {
const t = Math.min(1, (now - t0) / workMs);
setP((1 - Math.pow(1 - t, 3)) * 100);
if (t >= 1) { setState('done'); return; }
raf.current = requestAnimationFrame(tick);
};
raf.current = requestAnimationFrame(tick);
};
const level = 200 - (p / 100) * 188;
return (
<>
<style>{`
.ldl-card { display: grid; gap: 1.1rem; justify-items: center; padding: 1.4rem;
border: 1px solid #e7e5e4; border-radius: 1rem; font-family: 'Inter', sans-serif;
max-inline-size: 20rem; }
.ldl-tank { position: relative; display: grid; place-items: center; inline-size: 10rem; aspect-ratio: 1;
font: 700 1.5rem/1 inherit; }
.ldl-tank svg { position: absolute; inset: 0; }
.ldl-read { position: relative; display: grid; gap: .3rem; justify-items: center; }
.ldl-read small { font-size: .62rem; color: #78716c; }
.ldl-read[data-wet='true'] { color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.ldl-read[data-wet='true'] small { color: #fff; }
.ldl-glass, .ldl-rim { fill: none; }
.ldl-glass { stroke: #e7e5e4; stroke-width: 3; }
.ldl-rim { stroke: #d6d3d1; stroke-width: 1.5; }
.ldl-level { translate: 0 var(--ldl-level); }
.ldl-wave { animation: ldl-drift 3.2s linear infinite; }
.ldl-wave-b { fill: #99f6e4; opacity: .55; animation-delay: -1.6s; }
.ldl-wave-f { fill: #0d9488; }
@keyframes ldl-drift { to { translate: -100px 0; } }
.ldl-replay { border: none; background: none; color: #0d9488; font: 600 .78rem/1 inherit;
cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
@media (prefers-reduced-motion: reduce) { .ldl-wave { animation: none; } }
`}</style>
<div className="ldl-card">
<div className="ldl-tank" style={{ ['--ldl-level' as string]: `${level}px` }}
role="progressbar" aria-valuenow={Math.round(p)} aria-valuemin={0} aria-valuemax={100}
aria-label="Migration progress">
<svg viewBox="0 0 200 200" aria-hidden="true">
<defs>
<clipPath id="ldl-clip"><circle cx="100" cy="100" r="88" /></clipPath>
</defs>
<circle className="ldl-glass" cx="100" cy="100" r="88" />
<g clipPath="url(#ldl-clip)">
<g className="ldl-level">
<path className="ldl-wave ldl-wave-b" d={WAVE_B} />
<path className="ldl-wave ldl-wave-f" d={WAVE_F} />
</g>
</g>
<circle className="ldl-rim" cx="100" cy="100" r="88" />
</svg>
<div className="ldl-read" data-wet={p > 53}>
<b>{Math.round(p)}%</b>
<small aria-live="polite">{state === 'done' ? 'Ready' : 'Migrating…'}</small>
</div>
</div>
{state === 'done' && (
<button type="button" className="ldl-replay" onClick={run}>Run it again</button>
)}
</div>
</>
);
}
<!-- MigrationTank.vue — a liquid tank that fills to its ready label -->
<script setup lang="ts">
import { computed, onBeforeUnmount, ref } from 'vue';
import '@nabuxai/ui-core/css';
const props = defineProps<{ workMs?: number }>();
const waveB = 'M0 0 Q25 -6 50 0 T100 0 T150 0 T200 0 T250 0 T300 0 T350 0 T400 0 V220 H0 Z';
const waveF = 'M0 0 Q25 -9 50 0 T100 0 T150 0 T200 0 T250 0 T300 0 T350 0 T400 0 V220 H0 Z';
const state = ref<'working' | 'done'>('working');
const p = ref(0);
let raf = 0;
const level = computed(() => 200 - (p.value / 100) * 188);
const run = () => {
if (state.value === 'working') return;
state.value = 'working';
p.value = 0;
const t0 = performance.now();
const tick = (now: number) => {
const t = Math.min(1, (now - t0) / (props.workMs ?? 5200));
p.value = (1 - Math.pow(1 - t, 3)) * 100;
if (t >= 1) { state.value = 'done'; return; }
raf = requestAnimationFrame(tick);
};
raf = requestAnimationFrame(tick);
};
// Unmount aborts the frame loop — no tank fills behind the page.
onBeforeUnmount(() => cancelAnimationFrame(raf));
</script>
<template>
<div class="ldl-card">
<div class="ldl-tank" :style="{ '--ldl-level': `${level}px` }"
role="progressbar" :aria-valuenow="Math.round(p)" aria-valuemin="0" aria-valuemax="100"
aria-label="Migration progress">
<svg viewBox="0 0 200 200" aria-hidden="true">
<defs>
<clipPath id="ldl-clip"><circle cx="100" cy="100" r="88" /></clipPath>
</defs>
<circle class="ldl-glass" cx="100" cy="100" r="88" />
<g clip-path="url(#ldl-clip)">
<g class="ldl-level">
<path class="ldl-wave ldl-wave-b" :d="waveB" />
<path class="ldl-wave ldl-wave-f" :d="waveF" />
</g>
</g>
<circle class="ldl-rim" cx="100" cy="100" r="88" />
</svg>
<div class="ldl-read" :data-wet="p > 53">
<b>{{ Math.round(p) }}%</b>
<small aria-live="polite">{{ state === 'done' ? 'Ready' : 'Migrating…' }}</small>
</div>
</div>
<button v-if="state === 'done'" type="button" class="ldl-replay" @click="run">Run it again</button>
</div>
</template>
<style scoped>
.ldl-card { display: grid; gap: 1.1rem; justify-items: center; padding: 1.4rem;
border: 1px solid #e7e5e4; border-radius: 1rem; font-family: 'Inter', sans-serif;
max-inline-size: 20rem; }
.ldl-tank { position: relative; display: grid; place-items: center; inline-size: 10rem; aspect-ratio: 1;
font: 700 1.5rem/1 inherit; }
.ldl-tank svg { position: absolute; inset: 0; }
.ldl-read { position: relative; display: grid; gap: .3rem; justify-items: center; }
.ldl-read small { font-size: .62rem; color: #78716c; }
.ldl-read[data-wet='true'] { color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.ldl-read[data-wet='true'] small { color: #fff; }
.ldl-glass, .ldl-rim { fill: none; }
.ldl-glass { stroke: #e7e5e4; stroke-width: 3; }
.ldl-rim { stroke: #d6d3d1; stroke-width: 1.5; }
.ldl-level { translate: 0 var(--ldl-level); }
.ldl-wave { animation: ldl-drift 3.2s linear infinite; }
.ldl-wave-b { fill: #99f6e4; opacity: .55; animation-delay: -1.6s; }
.ldl-wave-f { fill: #0d9488; }
@keyframes ldl-drift { to { translate: -100px 0; } }
.ldl-replay { border: none; background: none; color: #0d9488; font: 600 .78rem/1 inherit;
cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
@media (prefers-reduced-motion: reduce) { .ldl-wave { animation: none; } }
</style>
<!-- MigrationTank.svelte — a liquid tank that fills to its ready label -->
<script lang="ts">
import { onDestroy } from 'svelte';
import '@nabuxai/ui-core/css';
let { workMs = 5200 } = $props();
const waveB = 'M0 0 Q25 -6 50 0 T100 0 T150 0 T200 0 T250 0 T300 0 T350 0 T400 0 V220 H0 Z';
const waveF = 'M0 0 Q25 -9 50 0 T100 0 T150 0 T200 0 T250 0 T300 0 T350 0 T400 0 V220 H0 Z';
let state = $state<'working' | 'done'>('working');
let p = $state(0);
let raf = 0;
const level = $derived(200 - (p / 100) * 188);
const run = () => {
if (state === 'working') return;
state = 'working';
p = 0;
const t0 = performance.now();
const tick = (now: number) => {
const t = Math.min(1, (now - t0) / workMs);
p = (1 - Math.pow(1 - t, 3)) * 100;
if (t >= 1) { state = 'done'; return; }
raf = requestAnimationFrame(tick);
};
raf = requestAnimationFrame(tick);
};
// Unmount aborts the frame loop — no tank fills behind the page.
onDestroy(() => cancelAnimationFrame(raf));
</script>
<div class="ldl-card">
<div class="ldl-tank" style={`--ldl-level: ${level}px`}
role="progressbar" aria-valuenow={Math.round(p)} aria-valuemin="0" aria-valuemax="100"
aria-label="Migration progress">
<svg viewBox="0 0 200 200" aria-hidden="true">
<defs>
<clipPath id="ldl-clip"><circle cx="100" cy="100" r="88" /></clipPath>
</defs>
<circle class="ldl-glass" cx="100" cy="100" r="88" />
<g clip-path="url(#ldl-clip)">
<g class="ldl-level">
<path class="ldl-wave ldl-wave-b" d={waveB} />
<path class="ldl-wave ldl-wave-f" d={waveF} />
</g>
</g>
<circle class="ldl-rim" cx="100" cy="100" r="88" />
</svg>
<div class="ldl-read" data-wet={p > 53}>
<b>{Math.round(p)}%</b>
<small aria-live="polite">{state === 'done' ? 'Ready' : 'Migrating…'}</small>
</div>
</div>
{#if state === 'done'}
<button type="button" class="ldl-replay" onclick={run}>Run it again</button>
{/if}
</div>
<style>
.ldl-card { display: grid; gap: 1.1rem; justify-items: center; padding: 1.4rem;
border: 1px solid #e7e5e4; border-radius: 1rem; font-family: 'Inter', sans-serif;
max-inline-size: 20rem; }
.ldl-tank { position: relative; display: grid; place-items: center; inline-size: 10rem; aspect-ratio: 1;
font: 700 1.5rem/1 inherit; }
.ldl-tank svg { position: absolute; inset: 0; }
.ldl-read { position: relative; display: grid; gap: .3rem; justify-items: center; }
.ldl-read small { font-size: .62rem; color: #78716c; }
.ldl-read[data-wet='true'] { color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.ldl-read[data-wet='true'] small { color: #fff; }
.ldl-glass, .ldl-rim { fill: none; }
.ldl-glass { stroke: #e7e5e4; stroke-width: 3; }
.ldl-rim { stroke: #d6d3d1; stroke-width: 1.5; }
.ldl-level { translate: 0 var(--ldl-level); }
.ldl-wave { animation: ldl-drift 3.2s linear infinite; }
.ldl-wave-b { fill: #99f6e4; opacity: .55; animation-delay: -1.6s; }
.ldl-wave-f { fill: #0d9488; }
@keyframes ldl-drift { to { translate: -100px 0; } }
.ldl-replay { border: none; background: none; color: #0d9488; font: 600 .78rem/1 inherit;
cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
@media (prefers-reduced-motion: reduce) { .ldl-wave { animation: none; } }
</style>