A button that fills with liquid from the bottom on hover.
Installation
Install the packages
npm install @prequelui/react motion@prequelui/react reuses the primitive library your components already depend on.
Add the component
npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/liquid-button.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/liquid-button.json
Turn on the motion
npx @prequelui/cli@latest animate liquid-buttonThe CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.
Usage
Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.
import { LiquidButton } from "@/components/prequelui/liquid-button";
export default function Demo() {
return (
<LiquidButton delay="0.3s" fillHeight="3px">
Fill me up
</LiquidButton>
);
}import { LiquidButton } from "@/components/prequelui/liquid-button";
export function Variant() {
return (
<LiquidButton tempo={1.2}>
…
</LiquidButton>
);
}Animation
A thin bar rests at the bottom edge. Hovering lets the liquid rise from that edge until it fills the button, while the label flips to the inverse colour; leaving drains it back down the same path.
- Fill duration: 300 ms on a soft ease-out.
- At rest the bar keeps a 3 px height so the affordance stays visible.
- Colour uses the same duration as the fill so text never flashes.
- Reduced motion keeps the final hover colour without the rising layer.
API Reference
Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.