Text Scribble

Hand-drawn scribble, squiggly underline, strike, circle, and box marks for text.

textscribbleunderlinestrike throughcircleannotationsvgtypography
Text Scribble component preview

Overview

Text Scribble is a React and Tailwind CSS scribble animation that sketches a hand drawn underline, squiggly underline, strike through, circle, or box onto words, in Next.js or any React app, with no dependencies. Each mark is an SVG stroke revealed by one stroke dashoffset transition, drawn in up to four rough passes. Lines follow wrapped text, while the circle and box loop the whole phrase and overshoot their start like a real pen. Marks refit on resize and font load and paint after hydration. Trigger on view or hover, or set drawn, and reduced motion draws instantly.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add text-scribble

Usage

Import TextScribble from @/components/wensity/text-scribble and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { TextScribble } from "@/components/wensity/text-scribble";
export default function Example() {
return (
<p className="font-display text-2xl text-zinc-900 dark:text-zinc-100">
I think wensity has the{" "}
<TextScribble type="scribble">
best components
</TextScribble>{" "}
on the internet.
</p>
);
}

Props

PropTypeDefaultDescription
childrenReact.ReactNode-The inline content to annotate.
type"scribble" | "underline" | "strike-through" | "circle" | "box""scribble"Annotation style. Scribble, underline and strike-through follow each wrapped line; circle and box loop the whole phrase.
colorstringchili (brand)Stroke color. Defaults to the Wensity brand (chili).
strokeWidthnumber2Stroke width in CSS pixels.
durationnumber0.9Seconds for the draw-on.
delaynumber0Seconds to wait before drawing.
trigger"view" | "hover" | "mount""view"When to draw. View draws once on-screen; hover draws and retracts.
iterationsnumber2 (scribble) / 1Sketch passes for the hand-drawn look, from 1 to 4.
paddingnumber2Extra px around the text before the mark is drawn.
drawnboolean-Force the draw state. When omitted the trigger drives it; reduced motion always draws instantly.
askeyof JSX.IntrinsicElements"span"Outer element tag.

Featured in React hero section components.