Signature

An interactive, animated signature writing component powered by opentype.js and framer-motion.

The Signature component parses standard OpenType font files dynamically, generates SVG vector paths for input text, and progressively reveals them using stroke and fill mask animations. It is ideal for headers, landing page landing seals, certificates, or interactive landing designs.

Preview

Usage

Installation

$ pnpm dlx shadcn add https://klarden.vercel.app/r/signature.json

Basic Example

import { Signature } from "@/components/klarden-ui/signature";

export default function App() {
  return (
    <Signature
      text="Antigravity"
      color="#ffffff"
      fontSize={60}
      duration={2.0}
    />
  );
}

Gradient and Glow Example

import { Signature } from "@/components/klarden-ui/signature";

export default function App() {
  return (
    <Signature
      text="Nebula Design"
      gradientColors={["#c084fc", "#e879f9", "#6366f1"]}
      fontSize={70}
      duration={2.2}
      glow={true}
      glowBlur={5}
    />
  );
}

Properties

PropTypeDefaultDescription
textstring"Signature"The text to render and animate.
colorstring"#ffffff"The solid color for the signature outline and fills (ignored if gradientColors is set).
gradientColorsstring[]undefinedAn array of color strings (e.g. ['#c084fc', '#6366f1']) to render the signature with a linear gradient.
fontSizenumber60Font size of the rendered text in pixels.
durationnumber1.5Duration of the drawing animation in seconds.
delaynumber0Delay before starting the drawing animation in seconds.
strokeWidthnumber1.5Thickness of the outline stroke drawn progressively.
maskStrokeWidthnumberfontSize * 0.25Thickness of the progressive path reveal mask.
glowbooleanfalseEnables the neon glow drop-shadow filter effect.
glowBlurnumber4Standard deviation blur for the neon glow effect.
glowColorstringundefinedCustom color for the neon glow (defaults to main signature color/gradient).
fontUrlstring"/Tomatoes-O8L8.ttf"URL of the OpenType (.otf/.ttf) cursive font file to parse.
inViewbooleanfalseIf true, starts the animation only when the signature scrolls into view.
oncebooleantrueIf true, runs the draw animation only the first time it enters view.
refreshKeystring | number0Changing this key forces the signature to remount and replay its stroke animation.