A button that presses down and never fidgets 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/button.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/button.json
Turn on the motion
npx @prequelui/cli@latest animate 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 { Button } from "@/components/prequelui/button";
export default function Demo() {
return (
<Button tapScale={0.97} onClick={() => console.log("pressed")}>
Get started
</Button>
);
}import { Button } from "@/components/prequelui/button";
export function Variant() {
return (
<Button tempo={1.2}>
…
</Button>
);
}Animation
The button answers a press and nothing else. It moves to 97% of its size on the same spring every time, then returns to rest; hover only changes colour unless a hover scale is explicitly requested.
- Press spring: stiffness 550, damping 30, restSpeed 10.
- Hover scale defaults to 1, so the button never grows under the pointer.
- Repeated presses retarget the running spring instead of queueing.
- Reduced motion removes the press scale and keeps the colour change.
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.