npx shadcn@latest add https://components.bksh.site/r/flipbook.json

Hand Drawn

Flipbook

Snaps between frames — emoji, text, or square images — with no easing and no fades.

Example.tsx
import { Flipbook } from "@/components/better/flipbook"
export function Example() {
return (
<Flipbook fps={4} jitter={true}>
<span></span>
<span></span>
<span>✌️</span>
</Flipbook>
)
}

Dependencies

None — just React and Tailwind CSS.

Props

PropTypeDefaultDescription
childrenReactNodeText/emoji frames — one child per frame. Ignored when `images` is set.
imagesstring[]Image frames, one src per frame. Give every image the SAME width and height (a square source, e.g. 256×256) — frames are drawn into a square `size`×`size` box, so mismatched aspect ratios get cropped and the flipbook appears to wobble between frames. /
altstring""Alt text for image frames (the whole sequence reads as one image).
sizenumber96Side of the square frame box, in px. Only applies to image frames.
classNamestring
fpsnumber4Frames per second — keep it low (2-8) for the stop-motion feel.
jitterbooleantrueAdd a tiny positional jitter to each frame, like a mis-registered camera.