Componentpickers3.16 KB gzipZero dependencies

Signature Pad

Interactive canvas endorsement pad with clear action and receipt stamp.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add signature-pad

Or install the full npm package:

npm install bigbullui

Usage

tsx6 lines
import { SignaturePad } from "@/components/ui/signature-pad"; <SignaturePad  title="TICKET HOLDER ENDORSEMENT"  onEndorse={(dataUrl) => console.log("Endorsed", dataUrl)}/>

Source code

signature-pad.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxsignature-pad.tsx508 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface SignaturePadProps  extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {  /** Canvas height in pixels (default: 160) */  height?: number;  /** Stroke color (default: "currentColor") */  strokeColor?: string;  /** Pen stroke line width in pixels (default: 2.5) */  strokeWidth?: number;  /** Header title on ticket receipt stub (default: "TICKET HOLDER ENDORSEMENT") */  title?: string;  /** Ticket or stub serial number (default: "STUB #BB-8841") */  stubNumber?: string;  /** Micro instruction below signature line */

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { SignaturePad } from "@/components/ui/signature-pad"; <SignaturePad />
PropTypeDescription
heightnumberCanvas height in pixels (default: 160)
strokeColorstringStroke color (default: "currentColor")
strokeWidthnumberPen stroke line width in pixels (default: 2.5)
titlestringHeader title on ticket receipt stub (default: "TICKET HOLDER ENDORSEMENT")
stubNumberstringTicket or stub serial number (default: "STUB #BB-8841")
instructionstringMicro instruction below signature line
stampTextstringText shown inside the rubber stamp seal (default: "SIGNED & ENDORSED")
defaultEndorsedbooleanWhether the pad is initially endorsed / stamped
disabledbooleanWhether the canvas is disabled / read-only
enableSoundbooleanWhether to play a synthesized rubber stamp thud sound (default: false)
onChange(dataUrl: string | null) => voidCallback fired whenever user finishes a stroke, receiving dataURL or null if empty
onClear() => voidCallback fired when signature is cleared
onEndorse(dataUrl: string) => voidCallback fired when user endorses the ticket, receiving the image dataURL
classNamestringOptional Tailwind or custom CSS classes merged with component styles.