Magoo Component UI logo Magoo Component UI
← Catalog

Signature Pad

signature-pad molecule experimental

A framed canvas field for drawing a signature with a mouse, pen or finger, with Clear and Done controls.

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default

Sign here to accept the agreement

Draw your signature using a mouse, pen or finger.

Minimal

Sign here

Hint

Props

NameTypeReq
label string
name string
hint string

Related components

How to use

The framed empty pad, baseline, label and buttons are pure markup, so the component renders (and screenshots) without JavaScript — the pad simply shows empty and framed there, which is expected. behavior.js makes it interactive with Pointer Events: pointerdown starts a stroke (with setPointerCapture so a drag off the canvas keeps drawing), pointermove extends it with a round line cap, pointerup ends it. The backing store is sized to the canvas box times devicePixelRatio on init for crisp lines. Clear wipes the canvas; Done exports a PNG data URL to the optional hidden input (name prop) and dispatches "signature:done" with { empty, dataUrl }. The portable self-init reads everything from the markup and passes no props object; all listeners are cleaned up on teardown.

Use cases

form-control WCAG AA SEO 15 dir: both ai-generated