Skip to content
Textlab
1
Browse

ComponentsDraw

Signature

A handwritten signature writes itself.

Ada Lovelace

Installation

$ npx shadcn@latest add @textlab/signature

Needs @textlab in your components.json. Setup takes a minute.

Usage

usage.tsx
import { Signature } from "@/components/textlab/signature/signature";

<Signature text="Ada Lovelace" />

Variants

penbrush

Props

PropTypeDefaultDescription
text*string–The name to sign.
variant"pen" | "brush""pen"A fine nib, or a fuller brush where ink pools sooner.
fontstringvar(--tl-font-script)Script font family. Load one with next/font, for example Mrs Saint Delafield.
colorstringcurrentColorInk color.
asElementType"span"Rendered element.
trigger"mount" | "inView" | "hover" | "manual""inView"What starts the animation. manual follows `active`.
activebooleanfalseDrives trigger="manual".
oncebooleantrueIn view: play once instead of on every entry.
delaynumber0Seconds before the first part moves.
durationnumber2.2Seconds each part takes.
reducedMotion"user" | "always" | "never""user"user follows the OS setting; always shows the still version.
classNamestring–Merged onto the root.
onComplete() => void–Called when a one-shot animation finishes.

When to use it

Reach for it

  • Founder letters, about pages and certificates.
  • Sign-offs at the end of a story.

Skip it

  • Without a script font loaded; system cursive fonts vary a lot.
  • Anything longer than a name.

Accessibility and motion

Accessibility

  • The name is read once from a hidden copy.
  • Script fonts are hard to read; keep the plain name nearby if it matters.

Motion

  • Writes left to right on a gentle in-out curve, like a hand gaining then losing speed.
  • Ink fills in behind the nib, never ahead of it.
Reduced motion. Shows the signature in full.

Performance

  • One SVG text and one animated mask rectangle.