CSS Liquid Fill Progress
A round gauge that fills with gently waving water up to the value set in a custom property.
<div class="liquid-progress" style="--progress: 60" role="progressbar" aria-label="Loading" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">60%</div>
.liquid-progress {
--progress: 50;
position: relative;
isolation: isolate;
display: grid;
place-items: center;
width: 120px;
height: 120px;
overflow: hidden;
border: 4px solid #0ea5e9;
border-radius: 50%;
background: #e0f2fe;
color: #0c4a6e;
font: 800 24px/1 system-ui, sans-serif;
}
/* Two big rotating rounded squares make the wavy surface */
.liquid-progress::before,
.liquid-progress::after {
content: "";
position: absolute;
top: calc((100 - var(--progress)) * 1% - 8px);
left: 50%;
z-index: -1;
width: 220%;
aspect-ratio: 1;
border-radius: 42%;
translate: -50% 0;
animation: liquid-progress-wave 7s linear infinite;
}
.liquid-progress::before {
background: #7dd3fc;
}
.liquid-progress::after {
top: calc((100 - var(--progress)) * 1% - 4px);
border-radius: 45%;
background: #38bdf8;
animation-duration: 10s;
}
@keyframes liquid-progress-wave {
to { rotate: 1turn; }
}
@media (prefers-reduced-motion: reduce) {
.liquid-progress::before,
.liquid-progress::after { animation: none; }
}
About this CSS Liquid Fill Progress
This CSS Liquid Fill Progress is 50 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, CSS Grid, aspect-ratio and custom properties. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
Change these custom properties to restyle the liquid fill progress without touching the rest of the CSS:
| Property | Default |
|---|---|
--progress | 50 |
How to use this liquid fill progress
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.liquid-progressclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.