Package-level declarations

Types

Link copied to clipboard
sealed class OtpAnimation

Entry, focus, and verification motion presets for OtpInput.

Link copied to clipboard
data class OtpAnimationConfig(val durationMillis: Int = 250, val bounceHeight: Dp = 8.dp, val scaleFactor: Float = 1.12f, val shakeDistance: Dp = 10.dp, val waveDelayMillis: Int = 70)
Link copied to clipboard
Link copied to clipboard
typealias PinFlowCellContent = @Composable (digit: Char?, state: PinFlowCellState) -> Unit

Custom renderer for a single OTP cell. Replaces the default digit androidx.compose.material3.Text while keeping cell chrome (border, background, animations) unless you fully customize via layout.

Link copied to clipboard
Link copied to clipboard
data class PinFlowColors(val focusedBorderColor: Color, val unfocusedBorderColor: Color, val errorBorderColor: Color, val successBorderColor: Color, val focusedContainerColor: Color, val unfocusedContainerColor: Color, val textColor: Color, val errorTextColor: Color, val successTextColor: Color, val glowColor: Color, val cursorColor: Color)
Link copied to clipboard
Link copied to clipboard
data class PinFlowDimensions(val cellWidth: Dp, val cellHeight: Dp, val spacing: Dp, val cornerRadius: Dp, val focusedBorderWidth: Dp, val unfocusedBorderWidth: Dp, val cursorWidth: Dp)
Link copied to clipboard
Link copied to clipboard
data class PinFlowStyle(val colors: PinFlowColors, val dimensions: PinFlowDimensions, val borderBrush: Brush? = null, val cursorColor: Color, val cursorWidth: Dp)
Link copied to clipboard

Preset light/dark-adaptive styles for PinFlow.

Link copied to clipboard
Link copied to clipboard
sealed class VerificationState

External verification lifecycle for OtpInput — drives progress, error shake, and success wave.

Functions

Link copied to clipboard
fun OtpInput(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, length: Int = 6, animation: OtpAnimation = OtpAnimation.Scale, verificationState: VerificationState = VerificationState.Idle, animationDuration: Int = 250, successAnimationDelay: Int = 80, shakeIntensity: Dp = 12.dp, enableHaptics: Boolean = true, animationConfig: OtpAnimationConfig = OtpAnimationConfig(), mode: PinFlowMode = PinFlowMode.Boxes, colors: PinFlowColors = PinFlowDefaults.colors(), dimensions: PinFlowDimensions = PinFlowDefaults.dimensions(), enabled: Boolean = true, onComplete: (String) -> Unit? = null, smsAutoFill: Boolean = false, clipboardSuggestion: Boolean = false, otpDetectionMode: OtpDetectionMode = OtpDetectionMode.Suggestion, allowedChars: OtpAllowedChars = OtpAllowedChars.DigitsOnly, onOtpDetected: (String) -> Unit = {}, onOtpFilled: (String) -> Unit = {}, suggestionContent: @Composable (code: String, source: OtpDetectionSource, onApply: () -> Unit, onDismiss: () -> Unit) -> Unit? = null)

Animated OTP input with verification-state feedback — the MVP 3 animation API.

Link copied to clipboard
fun PinFlow(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, length: Int = 4, mode: PinFlowMode = PinFlowMode.Boxes, secure: Boolean = false, revealLastDigit: Boolean = false, isAlphanumeric: Boolean = false, animations: Set<PinFlowAnimation> = PinFlowDefaults.animations(), style: PinFlowStyle? = null, colors: PinFlowColors = PinFlowDefaults.colors(), dimensions: PinFlowDimensions = PinFlowDefaults.dimensions(), keyboardOptions: KeyboardOptions = PinFlowDefaults.keyboardOptions( isAlphanumeric = isAlphanumeric, secure = secure || mode == PinFlowMode.SecurePin, ), keyboardActions: KeyboardActions = KeyboardActions.Default, isError: Boolean = false, isSuccess: Boolean = false, enabled: Boolean = true, maskChar: String = "", borderBrush: Brush? = null, cursorColor: Color? = null, cursorWidth: Dp? = null, cellContent: PinFlowCellContent? = null, hapticEnabled: Boolean = false, onComplete: (String) -> Unit? = null, otpAnimation: OtpAnimation? = null, animationConfig: OtpAnimationConfig = OtpAnimationConfig(), pulseWhenFocused: Boolean = true, onFocusChanged: (Boolean) -> Unit? = null)

Branded OTP / PIN input for Jetpack Compose — one hidden BasicTextField, animated visual cells.