Componentpickers3.16 KB gzipZero dependencies
Signature Pad
Interactive canvas endorsement pad with clear action and receipt stamp.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add signature-padOr install the full npm package:
npm install bigbulluiUsage
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 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| height | number | Canvas height in pixels (default: 160) |
| strokeColor | string | Stroke color (default: "currentColor") |
| strokeWidth | number | Pen stroke line width in pixels (default: 2.5) |
| title | string | Header title on ticket receipt stub (default: "TICKET HOLDER ENDORSEMENT") |
| stubNumber | string | Ticket or stub serial number (default: "STUB #BB-8841") |
| instruction | string | Micro instruction below signature line |
| stampText | string | Text shown inside the rubber stamp seal (default: "SIGNED & ENDORSED") |
| defaultEndorsed | boolean | Whether the pad is initially endorsed / stamped |
| disabled | boolean | Whether the canvas is disabled / read-only |
| enableSound | boolean | Whether to play a synthesized rubber stamp thud sound (default: false) |
| onChange | (dataUrl: string | null) => void | Callback fired whenever user finishes a stroke, receiving dataURL or null if empty |
| onClear | () => void | Callback fired when signature is cleared |
| onEndorse | (dataUrl: string) => void | Callback fired when user endorses the ticket, receiving the image dataURL |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |