An icon button that releases a small burst of particles.
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/icon-button.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/icon-button.json
Turn on the motion
npx @prequelui/cli@latest animate icon-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 { Bell } from "lucide-react";
import { IconButton, IconButtonParticles } from "@/components/prequelui/icon-button";
export default function Demo() {
return (
<IconButton aria-label="Notifications">
<Bell className="size-4" />
<IconButtonParticles />
</IconButton>
);
}import { IconButton } from "@/components/prequelui/icon-button";
export function Variant() {
return (
<IconButton tempo={1.2}>
…
</IconButton>
);
}Animation
A press releases a small burst around the icon. Eight dots leave from the centre on evenly spaced angles, shrink and fade in 550 ms; the button keeps the shared press spring underneath.
- Particles: 550 ms ease-out, 24 px travel, scale 0.8 → 0.2.
- The burst is remounted for every press, so rapid clicks never overlap.
- Particles are pointer-events none and aria-hidden.
- Reduced motion emits no particles and keeps the press feedback.
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.