https://github.com/sproctor/signaturepad
A multiplatform Compose library to draw smooth signatures.
https://github.com/sproctor/signaturepad
Last synced: about 1 year ago
JSON representation
A multiplatform Compose library to draw smooth signatures.
- Host: GitHub
- URL: https://github.com/sproctor/signaturepad
- Owner: sproctor
- License: apache-2.0
- Created: 2021-05-24T18:57:47.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-23T11:14:43.000Z (almost 2 years ago)
- Last Synced: 2024-08-23T12:31:59.683Z (almost 2 years ago)
- Language: Kotlin
- Homepage:
- Size: 440 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Compose Signature Pad
## Gradle dependency
### Multiplatform
```kotlin
implementation("com.seanproctor:signaturepad:$signaturepad_version")
```
As of 1.0.1, supported targets are Android, JVM, and JS (experimental canvas).
## Usage
```kotlin
val signaturePadState = rememberSignaturePadState()
SignaturePad(state = signaturePadState, penColor = Color.Black, penWidth = 3.dp)
Button(
onClick = {
val bitmap = ImageBitmap(600, 400)
signaturePadState.drawOnBitmap(penColor = Color.Black, penWidth = 2f)
submitSignature(bitmap)
},
) {
Text("Submit")
}
```