Assemble Text

Letters fly in from random spots and snap together into the word.

no dependenciesMIT · free

Hover to scatter again:

Installation

npx shadcn@latest add https://ombakui.com/r/assemble-text.json

Usage

import { AssembleText } from "@/components/assemble-text";

<AssembleText text="Coming together" className="text-6xl font-bold" />

Props

PropTypeDefaultDescription
text*string–The text. Plain text.
asElementType"span"HTML tag to render.
scatternumber160How far (px) letters start from their place.
durationnumber1100Milliseconds for the flight.
trigger"view" | "hover""view""view" assembles when scrolled into view; "hover" scatters and re-assembles on each hover.
classNamestring–