Examples

Signature capture

Preview

Sign inside the dashed area

Example.tsx
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

SignaturePad props
PropTypeDefault
labelrequired
Visible label and accessible name.
string—
width
Canvas width in pixels.
number420
height
Canvas height in pixels.
number160
penColor
Stroke colour.
string'#0f172a'
strokeWidth
Stroke thickness in pixels.
number2
onChange
Called on stroke end or clear.
(dataUrl: string | null) => void—

Keyboard interaction

Keyboard interactions
KeyAction
TabMove 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.