Signature
Signature allows users to provide a handwritten, typed, or uploaded signature with RTL support.
'use client'; import { Signature } from 'sdaia-ui'; export default function SignatureRealWorld() {Installation
npx sdaia-ui@latest add signature
Usage
import { Signature } from "@/components/ui/signature"<Signature type="draw" />Examples
Draw
Freehand drawn signature using mouse or touch input.
<Signature defaultType="draw" onAccept={(data) => console.log('Signature accepted', data)} onCancel={() => console.log('Cancelled')}/>Text
Signature generated from typed text.
<Signature defaultType="text" onAccept={(data) => console.log('Signature accepted', data)} onCancel={() => console.log('Cancelled')}/>Upload
Signature uploaded as an image file.
<Signature defaultType="upload" onAccept={(data) => console.log('Signature accepted', data)} onCancel={() => console.log('Cancelled')}/>API Reference
SignatureProps
Props for the Signature component.
Prop | Type | Default | Required |
|---|---|---|---|
type | 'draw' | 'text' | 'upload' | - | optional |
defaultType | 'draw' | 'text' | 'upload' | 'draw' | optional |
onTypeChange | (type: SignatureType) => void | - | optional |
helperText | string | "By signing this document, I certify that I have reviewed and accepted the agreement." | optional |
showHelperText | boolean | true | optional |
showOptions | boolean | true | optional |
showTabs | boolean | true | optional |
cancelLabel | string | 'Cancel' | optional |
acceptLabel | string | 'Accept and Sign' | optional |
onCancel | () => void | - | optional |
onAccept | (data?: string | File) => void | - | optional |
className | string | - | optional |