Back to Shark UI

Signature Pad

docs/components/signature-pad

latest6.1 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Signature Pad

Copy Markdown

Capture hand-drawn signatures.

DocsAPI

PreviewCode

Signature

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/signature-pad

Usage#

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

Examples#

Image preview#

Use the onDrawEnd callback to capture the signature as an image.

The callback receives the getDataUrl(type) method that returns a promise that resolves to a data URL.

PreviewCode

Signature

Image preview

With field#

Wrap the signature pad in a Field with FieldLabel and FieldHelper for accessible form integration.

PreviewCode

Signature

Signature

Draw your signature in the box above

API Reference#

SignaturePad#

Root component. Canvas for drawing signatures. Manages strokes and export.

PropTypeDefault
disabledbooleanfalse
requiredbooleanfalse
readOnlybooleanfalse
namestring-
onDraw(details: DrawDetails) => void-
onDrawEnd(details: DrawEndDetails) => void-
classNamestring-

For a complete list of props, see the Ark UI documentation.

[

Previous page

Sidebar ](/docs/components/sidebar)[

Next page

Skeleton ](/docs/components/skeleton)

On This Page

InstallationUsageExamplesImage previewWith fieldAPI ReferenceSignaturePad