Components

Boil

Makes drawn things shiver the way hand-animated line drawings do. About six times a second it moves to the next of a few frames: doodles are redrawn by a new hand, and buttons, cards and fields inside wobble a little differently. It stands still when motion is reduced, off screen and in a hidden tab.

Install

terminal
npx shadcn@latest add @wobko/boil

First time here? Add the registry to components.json first. How to install

Examples

Default

Four doodles, six redraws a second. The shapes hold still; the lines shiver. Stops when the tab is hidden, off screen, and with reduced motion.

Calm, normal, restless

fps and strength tune the shiver. Drawn controls inside a Boil feel it too (through the ink knobs), so a call to action can be alive without any doodle.

A live corner

A real use: the mascot in a card's corner and the underline of its heading boil, the text does not. Your own drawings join in with useBoilFrame or useBoilSeed.

API reference

Boil

A wrapper (an inline-block span). Direct children that take a `seed` (Doodle, Sticker, Mascot, Icon, Tape, Button…) get a new seed each frame; every drawn thing anywhere inside feels the frame through the ink context (wobble, fill offset, bleed and pen width move a few percent). Frames repeat, so after one turn every drawing comes from the cache: the cost is DOM updates, not drawing.

PropTypeDefaultDescription
fpsnumber6Redraws per second, 1 to 12.
framesnumber3How many different drawings it cycles through, 2 to 4.
strengthnumber1How far each frame is from the resting drawing: 0 none, 2 restless.
activebooleantrueTurn it off without unmounting (frame 0, the resting drawing).
reseedbooleantrueGive direct children a new seed each frame. Off: only the knobs move.
childrenReactNode | ({ frame, seed }) => ReactNode-A render prop gets the frame (0 to frames − 1) and `seed(base)`, for anything of your own that draws.

Accessibility

  • Boil changes drawings, never content or layout: the shapes do not move, the lines shiver by a fraction of a pixel to a couple of pixels. Nothing is announced and nothing takes focus.
  • Reduced motion (the OS setting, data-motion="reduced", or an InkProvider with motion="reduced") shows the resting drawing and runs no timer. The same happens while the tab is hidden and while the wrapper is scrolled out of view.
  • WCAG 2.2.2: a boil that runs for more than five seconds is moving content. It stops for people who ask for reduced motion, but give everyone else a way out where it matters: bind `active` to a pause control or to a preference. Children keep their state, focus and drawn ink across frames (they are re-seeded, never remounted).
  • Use it for a few live things (a mascot, a logo doodle, a call to action), not lists: every frame re-renders the children. The timer stops when the component unmounts.
  • Hooks for your own drawings: useBoilFrame() and useBoilSeed(seed) return the frame and a frame-suffixed seed inside a Boil, and the plain seed outside one.

Source

The files the CLI copies into your project.

Loading the source