React Native · Components
SignaturePad
Signature area: sign with a finger or a stylus.
5 exports
Live example
The preview runs in the browser with the web component; the native component takes the same props and looks the same on iOS and Android.
Preview
Code
Events
- Events appear here when you interact with the preview.
Import
SignaturePad
componentSignature area: sign with a finger or a stylus. Contract approval, delivery confirmation.
- Strokes are smoothed with the same rules as web; they thin with speed.
- Strokes are stored relative to the area; when the area size changes the signature is redrawn keeping its ratio. The value has the same format as the web
SignaturePad. - The enclosing scroll stops while drawing.
toSVG(),clear(),undo(),redo()viaref.
Examples
SignaturePoint
interfaceA point of a signature. Positions are fractions of the pad size (0–1).
| Name | Type | Description |
|---|---|---|
x | number | Horizontal position (0–1, relative to the pad width). |
y | number | Vertical position (0–1, relative to the pad height). |
w | number | Stroke width at this point (relative to the pad width). |
SignaturePadHandle
interfaceFunctions accessed on SignaturePad via ref.
| Name | Type | Description |
|---|---|---|
toSVG | () => string | Converts the signature to an SVG string (to send to a server or write to a file). |
clear | () => void | Clears the signature. |
undo | () => void | Undoes the last stroke. |
redo | () => void | Redoes what was undone. |
isEmpty | () => boolean | Is the signature empty? |
SignatureValue
typeThe whole signature: strokes in order.
SignaturePadProps
interfaceSignaturePad props.
Extends: FieldProps
| Name | Type | Default | Description |
|---|---|---|---|
value? | SignatureValue | Controlled signature (strokes; positions relative to the area). | |
defaultValue? | SignatureValue | Initial signature. | |
onValueChange? | (value: SignatureValue) => void | After each stroke ends, on clear and on undo. | |
color? | string | the theme's text color | Ink color. |
minWidth? | number | 0.8 | Thinnest stroke (px). |
maxWidth? | number | 2.8 | Thickest stroke (px). |
placeholder? | ReactNode | {@link UIProvider} `signatureHint` text | Hint shown while empty; null hides it. |
toolbar? | boolean | true | Undo, redo and clear buttons. |
readOnly? | boolean | Display only; cannot be drawn on. | |
disabled? | boolean | Disabled. | |
aria-label? | string | {@link UIProvider} `signatureLabel` text | Screen reader name. |
ref? | Ref<SignaturePadHandle> | Access: toSVG, clear, undo… | |
height? | number | 160 | Height of the area. |
style? | StyleProp<ViewStyle> | Container style. |