Skip to content
synccn

Signature Pad

Draw a signature with pressure, undo and clear; exports a PNG.

Sign to accept the agreement

Sign above the line

Installation

$ pnpm dlx shadcn@latest add @synccn/signature-pad

First time in this project? Connect synccn with one command.

Usage

import { SignaturePad } from "@/components/ui/signature-pad";<SignaturePad onChange={setPng} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

SignaturePad

Draw with mouse, pen or finger. onChange receives a PNG data URL (or null when cleared).

  • height
    number

    Default 180

    Canvas height in pixels.

  • stroke
    number

    Default 2.2

    Base line width in pixels.

  • onChange
    (dataUrl: string | null) => void

    PNG data URL after each stroke, or null when cleared.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

  • Drawing needs a pointer. If a signature is required, offer a typed alternative for keyboard users.

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-label