SignaturePad
v1.0.18NewUpdated 20 Oct 2026Dependency-free canvas signature capture with smooth quadratic-curve strokes and velocity-based pen width. DPR-aware and responsive (ResizeObserver redraw), undo/clear toolbar, read-only display from a data URL, and PNG
Preview
Live · 12 stories▸Why this is recommendedformsignaturecanvasdraw+5
The default, out-of-the-box SignaturePad.
- ✓Delivery / goods-received sign-off
- ✓Quotation and contract acceptance
- ✓Consent forms
- ✓POS acknowledgements
- Mouse / touch / pen via pointer events (coalesced events supported)
- Smooth quadratic-curve strokes with velocity-based width
- devicePixelRatio-aware sizing + ResizeObserver redraw
- Undo stroke / clear with built-in toolbar (localisable labels)
- Controlled (value/onChange) and uncontrolled (defaultValue) modes
- Read-only display mode from an initial data URL
- toDataURL(type, quality) + toSVG() via ref handle, onEnd(dataUrl) callback
- Pen colour from currentColor token (dark-mode safe)
- Keyboard: Backspace undoes last stroke, Escape cancels stroke in progress
- Hidden form input via name, sizes sm / md / lg
- Labelled by FormField: the canvas (role=img, not labelable) takes the id and is named by the field label through aria-labelledby; the built-in "Signature" name steps aside
- ✕Free-form sketching or image annotation (use a drawing tool)
- ✕Typed name confirmation (use Input)
Install
Ask your agent, or call the MCP tool directly. The resolved bundle is written into your project.
Usage
Tick variants in the left menu — each adds a tab with that variant’s real story source, the same code the preview above renders.
Props
valueControlled signature data URL
—defaultValueUncontrolled initial data URL
—onChangeFires on stroke end / undo / clear (null when empty); after a clear or undo while the pointer is still down, lifting that pointer reports nothing more (no onChange or onEnd)
—onEndFires when a stroke finishes
—sizeCanvas height preset
—strokeWidthBase pen width; actual width varies with velocity
—readOnlyDisplay-only render of the value
—disabledDisable drawing and toolbar
—refclear / undo / isEmpty / toDataURL / toSVG / focus
—aria-labelAccessible name of the surface; defaults to labels.signatureLabel ("Signature") except inside a labelled FormField
—aria-labelledbyId(s) of the element(s) that label the drawing surface; wins over a FormField label
—idDOM id set on the drawing surface; FormField clones its field id in, and its label then names the control
—aria-describedbyId(s) of hint or error text describing the drawing surface (joined with the instructions) (FormField clones this in)
—aria-invalidMark the drawing surface invalid; FormField clones this in from its error prop
—aria-requiredAccepted (FormField clones it in) but not rendered: ARIA does not allow it on role=img. The label text "required" is part of the name instead
—