DocsSignature

Signature

An animated SVG signature effect using Opentype.js and Framer Motion to draw out text as if hand-written.

Installation

Font Requirement: To enable the hand-written effect accurately, you must download the required font file and place it in your project's public directory.

Download LastoriaBoldRegular.otf
pnpm dlx shadcn@latest add @componentry/signature

Dependencies: framer-motion opentype.js

Usage

import { Signature } from "@/components/ui/signature"

<Signature text="Componentry" />

API Reference

PropTypeDefault
fontUrlstring

URL of a font file to load instead of the default Lastoria font paths.

—
textstring

Text to generate signature for.

"Signature"
colorstring

Color of the signature path.

"currentColor"
fontSizenumber

Font size of the signature.

32
durationnumber

Drawing duration per character in seconds. Characters start 0.2 seconds apart.

1.5
delaynumber

Delay before animation starts in seconds.

0
classNamestring

Additional CSS classes.

—
inViewboolean

Only animate when in view.

false
onceboolean

Animate only on the first viewport entry when inView is enabled.

true

Working with this component

When to use it

Use Signature for a name, a short sign-off, or a handwritten accent. It generates SVG paths from text; it does not capture handwriting or sign a document.

Font loading and timing

Serve LastoriaBoldRegular.otf from your public directory, or pass fontUrl for another font asset. If no font loads, the component has no paths to draw. Duration applies to each character, and characters start 0.2 seconds apart, so longer phrases take longer to finish.

Playing on entry

Set inView to start when the SVG enters the viewport. With inView enabled, once controls whether it can animate on later entries. Keep a readable text equivalent when the name conveys essential information.

Keep in mind

This component is inspired by various open-source projects and patterns. Please verify licenses and implementation details before using in production.

Need a custom component?

I build bespoke UI components & websites tailored to your brand.

DM me on X
PreviousScroll Tilted GridNextSpiral 3D Slider