Skip to content
ReactHive

Shoal

A headline swum by a shoal of sardines, printed as a cyanotype. The fish stream in, mill in a slow crescent, then settle into the word, each one holding its place against a current. The pointer is a predator: the shoal splits round it and closes behind. A click sends them swirling off into the next word.

TextReactHive OriginalNo packages, just React and Tailwind CSS
ShoalText

How It Works

Each word is drawn off screen and filled with an even scatter of points, the spacing searched until there's one point per fish; fish take the points in left-to-right order so the shoal pours rather than crosses. Every fish is a damped spring toward its point, or toward its place on a rotating crescent while milling. Near the pointer it's pushed away and sideways, harder the closer it is, and a fear that fades over a second loosens its spring, so the hole heals slowly. Heading follows velocity when swimming and a slow current field when holding; tail speed follows swimming speed.

Use It

Install it with shadcn, or copy the file into your components folder, then use it like this. Change a setting in the demo and the example picks it up. Works with Next.js (App Router) and any React 19 project on Tailwind CSS v4.

npx shadcn@latest add @reacthive/shoal
Example
<div className="relative h-svh">
  <Shoal words={["SHOAL", "DRIFT"]} className={font.className} weight={400} />
</div>
  • It fills its parent, which needs a size. The letters are fitted to it in the parent's own font: pass a next/font className and the font's weight. Short words in a heavy font read best.
  • words are swum one at a time; a click moves to the next, and interval cycles them by itself (0 holds). density is fish per 1,000 square pixels, so phones get fewer; fear is how hard they flee, 0 to 2. ink and paper are the print's colours.
  • Screen readers get every word as text. With reduced motion the fish are printed in place, still.
  • No packages: two canvases, one painted once for the paper and one drawn each frame for the fish, from twelve pre-drawn tail positions. The loop pauses when it's off screen.

Shoal, Answered.

Free to use, what it needs and where it came from.

Your Next Site Starts with a Live Demo.

Click around first. What you see is exactly what you download.

Start a Project

Tell us what you're making. A few lines is plenty; we'll ask the rest on a call.

What do you need?
Rough budget (optional)

Or email projects@reacthive.dev