A repository star count that ticks up and bursts into 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/github-stars.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/github-stars.json
Turn on the motion
npx @prequelui/cli@latest animate github-starsThe 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 { GitHubStars } from "@/components/prequelui/github-stars";
export default function Demo() {
return (
<GitHubStars>
{/* compose the parts exactly like the underlying primitive */}
</GitHubStars>
);
}import { GitHubStars } from "@/components/prequelui/github-stars";
export function Variant() {
return (
<GitHubStars tempo={1.2}>
…
</GitHubStars>
);
}Animation
This component adds a behaviour that ordinary primitives do not provide. Its motion is continuous and interruptible: dragging, hovering and scrolling retarget the same animated values instead of restarting an animation.
- Pointer-driven values are never re-created on render.
- Releasing or leaving hands control back to the same spring.
- Boucles et animations autonomes are paused when the tab or element is out of view.
- Reduced motion keeps the state change and removes the travel.
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.
GitHub Stars
| Prop | Type | Default |
|---|---|---|
| children | ReactNode | — |
| disabled | boolean | false |
| transition | Transition | spring.press |
| className | string | — |