Slow gradient blobs that float and turn behind the content.
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/bubble.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/bubble.json
Turn on the motion
npx @prequelui/cli@latest animate bubbleThe 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 { BubbleBackground } from "@/components/prequelui/backgrounds/bubble";
export default function Demo() {
return (
<div className="relative h-96 overflow-hidden rounded-xl">
<BubbleBackground interactive />
</div>
);
}import { Bubble } from "@/components/prequelui/bubble";
export function Variant() {
return (
<Bubble tempo={1.2}>
…
</Bubble>
);
}Animation
Six coloured blobs share one soft-material filter. Five drift and rotate on long loops; the sixth only appears when the pointer is inside the container and follows it on a 100 / 20 spring, so the scene responds without turning into a cursor toy.
- Loops run from 20 s to 40 s depending on the blob; speed divides every duration.
- The goo filter blurs the source by 16 px and blends it back with the original.
- Pointer tracking is sampled once per animation frame and cached, never per move.
- Reduced motion freezes the blobs at distinct angles and hides the pointer blob.
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.
BubbleBackground
| Prop | Type | Default |
|---|---|---|
| interactive | boolean | false |
| colors | BubbleColors | violet / amber / teal |
| transition | Transition | component spring |
| speed | number | 1 |
| paused | boolean | false |
| className | string | — |