Compose Multiplatform Views
The scandit-kmp-datacapture-id-compose module exposes ID capture as a @Composable
function. See Using the SDK with Compose Multiplatform for the shared setup.
Dependency
Add the ID Compose companion to your commonMain source set (it pulls in the base id
module transitively); it builds on core-compose:
commonMain.dependencies {
implementation("com.scandit.datacapture.kmp:core-compose:<version>")
implementation("com.scandit.datacapture.kmp:id-compose:<version>")
}
ID Capture
@Composable
fun IdScreen() {
IdCaptureView(
settings = IdCaptureSettings.idCaptureSettings(),
modifier = Modifier.fillMaxSize(),
overlayStyle = IdLayoutStyle.ROUNDED,
onCapture = { capturedId -> /* handle the captured document */ },
onReject = { capturedId, reason -> /* handle rejection */ },
)
}