Liquid Charge Capsule
A glass capsule with a two-layer sloshing liquid that rises to the charge level. Colour warms from ember red to calm emerald as it fills, bubbles rise and pop while charging, a brushed-metal bolt floats in the glass and a soft pulse celebrates a full charge.
Try it: Watch Auto charge and drain — or drag the capsule / use arrow keys to set the level.
Installation
Install with the shadcn CLI:
npx shadcn@latest add https://www.framekitui.live/r/liquid-charge-capsule.jsonOr, with the @framekit namespace registered: npx shadcn@latest add @framekit/liquid-charge-capsule. You can also copy the source into components/ui/liquid-charge-capsule.tsx (view on GitHub).
Usage
import { LiquidChargeCapsule } from '@/components/ui/liquid-charge-capsule'Props
| Prop | Type | Default | Notes |
|---|---|---|---|
level | number | 64 | Charge 0–100; the liquid springs to it and sloshes. |
charging | boolean | false | Bubbles, stirring surface and the floating bolt. |
height | number | 232 | Capsule height in px (width follows). |
lowThreshold | number | 20 | At or below: red liquid and a low-battery status. |
showReadout | boolean | true | Counting percentage and status line. |
onLevelChange | (level: number) => void | — | Turns it into a vertical slider (drag, arrows, Home/End). |
onFull | () => void | — | Fires when it reaches 100 while charging (with a celebration pulse). |
label | string | 'Battery' | Accessible name; exposed as a meter (or slider). |
Dependencies
motion
Related Loading components
- Ghost Gobbler Skull
A glossy vinyl-toy skull that tracks little black-smoke ghosts drifting in from every direction, drops its jaw, slurps each one in like spaghetti and CHOMPS — then levels up: glowing eyes, blush…
- Morph Glyph Loader
Glyph morphs through abstract SVG shapes.
- Particle Morph Loader
A depth-lit swarm of motes spins in 3D and melts between sphere, ribbon, shell, tetra, ring and helix while a status word rolls underneath.
- Ink Drip Loader
Ink drops merge into a looping puddle.
- Lattice Pulse Loader
3×3 nodes pulse in a traveling wave.
- Orbital Bead Loader
Beads orbit a core; hover speeds up.