Skip to content
English
Signature pad comes with Pro. Its preview shows once you unlock it.

How it works

Strokes are stored as points with a width rather than as pixels. Coalesced pointer events give dense samples; each segment is a quadratic curve from midpoint to midpoint, and the width follows speed through a low-pass filter so it never steps. Because the data is kept, undo is exact, the canvas redraws sharply at any pixel ratio, the signature rescales when the pad changes width, and the ink colour follows the theme.

Use it for

  • Accepting a proposal, a delivery or a consent form where a drawn signature is expected.
  • Collecting a quick sketch or initials on a tablet or phone.

Look elsewhere when

  • A legally binding signature flow on its own: pair it with identity and audit steps on the server.
  • As the only way to confirm: always offer a typed-name or checkbox alternative for people who cannot draw.

Usage

import { useRef, useState } from 'react'
import { SignaturePad } from './SignaturePad.jsx'

export function SignStep() {
  const pad = useRef(null)
  const [empty, setEmpty] = useState(true)
  return (
    <>
      <SignaturePad ref={pad} height={180} onChange={(s) => setEmpty(s.isEmpty)} />
      <button disabled={empty} onClick={() => upload(pad.current.toSVG())}>
        Accept and sign
      </button>
    </>
  )
}

Props

PropTypeDefaultWhat it does
onChange({ isEmpty, strokes }) => void—Called after each stroke, undo or clear.
defaultStrokes[x, y][][]—Strokes to start with, as points normalised to the pad (0 to 1), such as a saved signature.
heightnumber180Pad height in px; the width fills the container and the drawing rescales with it.
minWidthnumber0.9Thinnest line, at fast strokes.
maxWidthnumber3.2Thickest line, at slow strokes; pen pressure can add up to 30%.
colorstring—Ink colour. By default the ink follows --ds-sign-ink, then --ds-text, so it flips with the theme.
baselinebooleantrueDraws the dashed line and × mark.
disabledbooleanfalseLocks the pad, for example after submitting.
labelsobject—Replaces built-in text: pad, hint, undo, clear, empty, signed, strokes(n).
ref{ undo, clear, isEmpty, toDataURL, toSVG }—Imperative handle: toDataURL(type) returns an image, toSVG() a resolution-free path drawing.

Accessibility

  • The canvas is a focusable role="img" whose label states whether it is signed and how many strokes it has.
  • Keyboard: Ctrl / Cmd+Z undoes the last stroke, Delete or Backspace clears. Drawing itself needs a pointer, so offer a typed alternative next to it.
  • Undo and Clear are real buttons, 32px high, hidden only while the pad is empty.
  • touch-action: none stops the page from scrolling while signing. Reduced motion removes the hint and tool fades.

Motion

Ink appears under the pen with no delay. The hint fades and rises 4px in 240ms when the first stroke starts; the tools fade in over 200ms once there is something to undo.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

SignaturePad.jsxsignature-pad.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Form inputs
Availability grid comes with Pro. Its preview shows once you unlock it.
Boolean operations comes with Pro. Its preview shows once you unlock it.
Cascader comes with Pro. Its preview shows once you unlock it.