Signature pad
Smooth ink that thins with speed, with undo, replay, and PNG or SVG export.
npx shadcn@latest add @silicon-ui/signature-padInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/signature-padManually
Install the dependencies
npm install lucide-react motionCopy these files into your project
- components/silicon-ui/signature-pad/signature-pad.tsx
- components/silicon-ui/signature-pad/signature-pad.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
signerPrinted under the baseline, such as the signer's name. | string | — |
hintResting hint on the baseline before the first stroke. | string | "Sign here" |
defaultColor | InkColor
| "black" |
defaultWidth | InkWidth
| "medium" |
onChangeReceives the strokes after every change. | (strokes: InkStroke[]) => void | — |
fileNameFile name for exports, without extension. | string | "signature" |
labelAccessible name of the drawing surface. | string | "Signature pad" |
className | string | — |
Dependencies
- npm
- lucide-reactmotion
- Registry
- silicon-motion-tokens