A waterline gauge: the line's height is your metric (quota used, queue depth), a tag rides it, the shapes float up with it and can be dunked by pointer or keyboard.
Press mePress me
Team plan, 10 GB
4 call recordings, plus files and exports. 3.6 GB left
float-line, lively
Use Float Line where a single fill level is the whole story: storage or seat quota, a queue against its capacity, a monthly allowance. Pass value and the waterline becomes a gauge: its height is the metric, a tag rides the line in a right-hand gutter with a small scale, and a dashed brim marks full. A new value fills or drains the water on a slow spring, and the floating shapes ride it up with a small lag, so the change reads at a glance. The shapes still respond to the person: press one under and let go, it jumps out, bobs and sends a small wave to its neighbours. Slow tinted caustics drift in the water. Without value it is the same scene as pure art, for an empty state.
For a precise number with no picture, use Number Ticker or a progress bar.
pnpm dlx shadcn@latest add @motionkit-pro/float-linenpx shadcn@latest add @motionkit-pro/float-lineyarn dlx shadcn@latest add @motionkit-pro/float-linebunx --bun shadcn@latest add @motionkit-pro/float-lineRequires a Pro license and the @motionkit-pro registry with your token. See Installation.
import { FloatLine } from "@/components/ui/float-line"
export function Storage({ usedGb }: { usedGb: number }) {
return (
<FloatLine value={usedGb} max={10} meterLabel="Storage used" label={`${usedGb} GB`}>
<FloatLine.Stage className="h-64 w-full" />
</FloatLine>
)
}FloatLine is the pointer surface and FloatLine.Stage the art. value runs from min (default 0, the line at level) to max (default 100, the line near the top of the art). label is the tag's content (any node: a string or a Number Ticker), it defaults to the percentage. valueText is what a screen reader says, and meterLabel names the gauge.
Presets: trio (ball, pill, tile), duo (a big ball and a tile, for narrow columns) and armada (five smaller pieces for wide bands). variant="band" (default) is a full-width band where the line runs edge to edge; variant="aside" is a contained 4:3 basin beside or above the copy.
<FloatLine preset="armada" level={0.7} buoyancy={64} temperament="playful">
<FloatLine.Stage className="h-64 w-full">
<FloatLine.Shape kind="ball" x={25} size={140} draft={0.45} />
<FloatLine.Shape kind="tile" x={70} size={110} draft={0.35} />
</FloatLine.Stage>
</FloatLine>level is where the line sits at an empty gauge (0.4 to 0.8 of the box from the top; a lower line leaves more room to fill), buoyancy is how far a released shape clears the water (16 to 80px) and draft is the share of a shape under water at rest. At most five shapes. Set the character for the whole app with MotionKitProvider, or per instance with temperament (calm, lively, playful). It changes motion intensity only, never the drawing.
The water, the submerged cut and the caustics are tints of --brand (shipped with the item); the shapes use card, the line foreground.
Prop
Type
Also accepts all props of ComponentProps<"div">.
Prop
Type
Also accepts all props of ComponentProps<"div">.
Prop
Type
An aside gauge of a data tool: the water is the files waiting against the queue's capacity. Importing a batch drains it, a folder sync fills it.
Press mePress me
18 files waiting
CSV and Parquet files land here before they reach your tables. The queue holds 40; past that, the sync pauses.
float-line, lively
Without value: the duo preset as pure art under an empty notifications list.
Press mePress me
Nothing new
Mentions, approvals and failed runs show up here.
float-line, lively
kind takes a built-in name or any SVG path with its viewBox: { d, viewBox }. The viewBox's larger side takes the size. The meniscus follows the real outline: its widths are read once from the path and looked up per frame.
Press mePress me
Sync queue
Last run 2 min agoQueue is empty
Every record is synced. New changes are picked up on the next run.
float-line, lively
const star = {
d: "M50 2L61.8 35.6H97.6L68.9 57L79.6 91L50 70.4L20.4 91L31.1 57L2.4 35.6H38.2Z",
viewBox: "0 0 100 95",
}
const drop = { d: "M40 0C52 18 80 42 80 66A40 34 0 0 1 0 66C0 42 28 18 40 0Z", viewBox: "0 0 80 100" }
<FloatLine>
<FloatLine.Stage>
<FloatLine.Shape kind={star} x={22} size={180} draft={0.4} />
<FloatLine.Shape kind={drop} x={56} size={170} draft={0.45} />
<FloatLine.Shape kind="tile" x={84} size={104} />
</FloatLine.Stage>
</FloatLine>value, the tag is a role="meter" with aria-valuemin, aria-valuemax, aria-valuenow, aria-valuetext (from valueText, a string label or the percentage) and the name from meterLabel. Say the unit in valueText ("6.4 GB of 10 GB").aria-hidden SVG. Each shape has a focusable stand-in button laid over it ("Dunk the ball"), grouped as "Floating shapes", with a visible focus ring around the piece.card and card-foreground, so its text keeps AA contrast over the water in light and dark.touch-action: pan-y keeps vertical scrolling.| Key | Action |
|---|---|
Tab | Focuses the shapes (one tab stop for the group) |
ArrowRight / ArrowDown, ArrowLeft / ArrowUp | Next or previous shape |
Home / End | First or last shape |
Space / Enter | Hold to sink the focused shape; release and it jumps out. Leaving the shape lets it go |
interactive={false} removes the buttons: the art then has no focusable part.
With reduced motion the picture is complete and still: the shapes rest at their drafts on the gauge's level and the caustics do not drift. A new value moves the line and the shapes at once. A press sinks the shape on a critically damped spring and it floats back up: no jump, bob, stretch, wave, drift or scroll level change.
requestAnimationFrame loop simulates the bodies and the level, and stops when everything is at rest.Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
press, pointer movement, keyboard focus, a value change, scroll, ambient loop (pauses off screen and in hidden tabs)
The rest picture with still caustics: shapes at their drafts on the gauge's level; a new value moves the line at once, a press sinks a shape and it floats back with no jump, bob, stretch or wave.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)