Inputs
SignaturePad
Pointer-accessible signature capture pad with undo, clear, and PNG data URL output.
import { SignaturePad } from '@reactloom/ui';Examples
Signature capture
Sign inside the dashed area
import { SignaturePad } from '@reactloom/ui';
import { useState } from 'react';
export default function BasicSignaturePad() {
const [signed, setSigned] = useState(false);
return (
<div>
<SignaturePad label="Authorized signature" onChange={(url) => setSigned(Boolean(url))} />
<p style={{ marginTop: 8, fontSize: 13 }}>{signed ? 'Signature captured' : 'Sign inside the dashed area'}</p>
</div>
);
}API reference
| Prop | Type | Default |
|---|---|---|
labelrequiredVisible label and accessible name. | string | — |
widthCanvas width in pixels. | number | 420 |
heightCanvas height in pixels. | number | 160 |
penColorStroke colour. | string | '#0f172a' |
strokeWidthStroke thickness in pixels. | number | 2 |
onChangeCalled on stroke end or clear. | (dataUrl: string | null) => void | — |
Keyboard interaction
| Key | Action |
|---|---|
| Tab | Move focus between Undo and Clear action buttons |
Usage guidelines
Do
- Offer an alternative typed-name confirmation for users who cannot draw with a pointer.
Don’t
- Avoid tiny canvas heights below 120px on touch devices.