suiss/ui · Component
Signature Pad
A drawing area that captures a handwritten signature as strokes and can export it as an SVG string.
Signature Pad is an open-source component from suiss/ui for React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.

SignaturePad is a View with a single-finger pan gesture from react-native-gesture-handler. Each touch records a stroke of points, and the strokes are drawn as smoothed paths with react-native-svg. A signature line with an × mark and a placeholder sits near the bottom, and a ghost Clear button appears in the top corner once something is drawn.
Installation
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Examples
Signed
A pad that starts with a saved signature.

Thick stroke
A signature drawn with strokeWidth={5}.

Disabled
A disabled pad that ignores touches and hides the Clear button.

Controlled
A controlled pad that reads the signature through the ref and exports it with toSVG.

Accessibility
- The pad is a single accessible element labeled by
accessibilityLabel. - Its value is announced as "Empty" or "Signed", and
disabledis reported in its state. - When it has a signature and is not disabled, it offers a
clearaccessibility action, so VoiceOver and TalkBack users can clear it without finding the button.
API Reference
SignaturePad
The SignaturePad component captures a handwritten signature as strokes.
| Prop | Type | Default |
|---|---|---|
value | SignaturePadStroke[] | - |
defaultValue | SignaturePadStroke[] | - |
onChange | (value: SignaturePadStroke[]) => void | - |
strokeWidth | number | 2.5 |
disabled | boolean | false |
placeholder | React.ReactNode | "Sign here" |
clearLabel | React.ReactNode | "Clear" |
ref | React.Ref<SignaturePadHandle> | - |
Also accepts the props of React.ComponentProps<typeof View>.
Use it uncontrolled with defaultValue, or controlled with value and onChange. The value is an array of strokes, where each stroke is an array of { x, y } points. onChange is called with the full list of strokes after each stroke ends or the pad is cleared. Points closer than one point to the previous point are skipped while drawing. disabled turns off drawing, hides the Clear button and dims the pad. placeholder is shown on the signature line while the pad is empty.
Pass a ref to get a SignaturePadHandle with toSVG(), clear() and isEmpty(). toSVG returns an SVG string sized to the pad and accepts an optional color (defaults to currentColor). The SignaturePadHandle, SignaturePadPoint and SignaturePadStroke types are also exported.
SignatureStroke
| Parameter | Type | Default |
|---|---|---|
_ points | [CGPoint] | - |
| Property | Type |
|---|---|
points | [CGPoint] |
SignaturePad
The SignaturePad component captures a handwritten signature as strokes.
| Parameter | Type | Default |
|---|---|---|
value | Binding<[SignatureStroke]> | - |
strokeWidth | CGFloat | 2.5 |
placeholder | LocalizedStringKey | "Sign here" |
clearable | Bool | true |
SignaturePad.path
| Parameter | Type | Default |
|---|---|---|
_ strokes | [SignatureStroke] | - |
strokeWidth | CGFloat | 2.5 |
Returns Path.
SignaturePad.image
| Parameter | Type | Default |
|---|---|---|
_ strokes | [SignatureStroke] | - |
size | CGSize | - |
strokeWidth | CGFloat | 2.5 |
color | Color | EsuissColor.foreground |
colorScheme | ColorScheme | .light |
scale | CGFloat | 3 |
Returns UIImage?.
SignatureStroke
| Parameter | Type | Default |
|---|---|---|
points | List<Offset> | - |
toPath
Receiver: List<SignatureStroke>.
| Parameter | Type | Default |
|---|---|---|
scale | Float | 1f |
Returns Path.
toSvg
Receiver: List<SignatureStroke>.
| Parameter | Type | Default |
|---|---|---|
width | Float | - |
height | Float | - |
strokeWidth | Float | 2.5f |
color | String | "#000000" |
Returns String.
toImageBitmap
Receiver: List<SignatureStroke>.
| Parameter | Type | Default |
|---|---|---|
width | Dp | - |
height | Dp | - |
density | Density | - |
color | Color | Color.Black |
strokeWidth | Dp | 2.5.dp |
background | Color | Color.Transparent |
Returns ImageBitmap.
SignaturePad
The SignaturePad component captures a handwritten signature as strokes.
| Parameter | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
value | List<SignatureStroke>? | null |
onValueChange | ((List<SignatureStroke>) -> Unit)? | null |
defaultValue | List<SignatureStroke> | emptyList() |
strokeWidth | Dp | 2.5.dp |
enabled | Boolean | true |
placeholder | String | "Sign here" |
clearLabel | String | "Clear" |
showClearButton | Boolean | true |




