Water Progress Bar

Pro

A progress bar that fills with water, its rippling front leaning as it runs.

progress barwaterliquidwaveuploadloadingsvg
Water Progress Bar component preview

Overview

Water Progress Bar is a React and Tailwind CSS liquid progress bar that fills with water from left to right, in Next.js or any React app. Pass value from 0 to 100 and the water runs there on a critically damped spring without overshoot, its front rippling and leaning forward while it moves, then calming once it stops. A caption and live percentage sit above, and an optional scale below takes the water's color as it passes each tick. Omit value to loop. It draws at its measured pixel width, so the ripples never stretch.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add water-progress-bar

Usage

Import WaterProgressBar from @/components/wensity/water-progress-bar and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { WaterProgressBar } from "@/components/wensity/water-progress-bar";
export default function Example({ progress }: { progress: number }) {
return (
<div className="w-full max-w-md space-y-8">
<WaterProgressBar value={progress} caption="Uploading hero-reel.mp4" size="lg" />
<WaterProgressBar caption="Backing up workspace" size="sm" scale={false} />
</div>
);
}

Props

PropTypeDefaultDescription
valuenumber-Progress from 0 to 100. Omit it for an indeterminate bar that rolls back and forth.
captionReact.ReactNode-Text above the bar on the left. The percentage sits on the right.
colorstring"#2f7bff"Water color, any CSS color. The scale ticks take it as the level passes them.
size"sm" | "md" | "lg""md"Bar thickness: 10, 18, or 28 pixels.
wavenumber0.5Ripple height on the leading edge, from 0 for a flat front to 1.
speednumber1Playback rate of the ripples, bubbles, and indeterminate roll.
bubblesbooleantrueBubbles drifting through the water toward the front.
scalebooleantrueTick scale under the bar, from 0 to 100.
showValuebooleantrueShows the percentage above the bar. Hidden while indeterminate.
formatValue(percent: number) => string-Formats the percentage. Receives a whole number from 0 to 100.
labelstring-Accessible name. Defaults to the caption when it is a string.