PIN Input

The PIN input field is often used when users are required to provide a string of characters to securely access their accounts and data and authorize sensitive actions.

TypeResource
DesignFigma
MobileMobile Storybook
CodeGitlab

PIN Input Preview

Usage

import id.co.biofarma.binduiandroid.components.pin_input.PinInput
PinInput(
    label = "Label",
    pinLength = 6,
    helperText = "Helper text",
    errorText = "Error message",
    //isError = isError.value,
    value = pin,
    onComplete = {
        Toast.makeText(context, "$it", Toast.LENGTH_SHORT).show()
    },
    isError = false,
    isDisabled = false,
    onValueChange = { value ->
        Log.d("PinInput", "value change: ${value}")
    }
)

Examples

Disabled (optional)

Use disabled to restrict the input pin value from being entered.

PIN Input Example Disabled


Error (optional)

Use error when there is an error in the pininput value.

PIN Input Example Error


Mode (optional)

Use mode to use dark or light.

PIN Input Example Mode


Props

PropsRequiredDefaultTypedescription
idfalse-stringA unique identifier for the pin input.
stylefalse-ModifierCustom styles for the pin input component.
labelfalse-stringThe label text for the pin input.
cellSizefalse-Float = dpToPx(18f)Cell size for each input pin field.
cellPaddingfalse-Float = dpToPx(4f)Cell padding for each input pin field.
rowPaddingfalse-Float = dpToPx(4f)Row padding for each input pin field.
cellShapefalse-Shape = RoundedCornerShape(4.dp)Cell shape for each input pin field.
cellBorderWidthfalse-Float = dpToPx(0.5f)Cell border width for each input pin field.
valuesfalse-stringThe information value of the pin input.
onValueChangefalse-(String) -> UnitA callback function to be executed when entering the value of an pin input.
helperTextfalse-stringHelper text information to provide pin input information.
errorTextfalse-stringError text information to provide input pin information if it is an error.
pinLengthfalse-intValue with the length of the pin input.
isErrorfalsefalsebooleanIf true, pin input will be set to error state.
isDisabledfalsefalsebooleanIf true, pin input will be set to disabled state.
errorTextfalse-stringError text information to provide input pin information if it is an error.
disabledfalsefalsebooleanIf true, pin input will be set to disabled state.
onCompletefalse-((String) -> Unit)A callback function that will be executed when finished entering the pin input value.
BIND © Biofarma Innovate Next-level Design .