Vgs Cvc Text Field State
Immutable state for a VGS card security code (CVC/CVV) field.
Obtain an instance with rememberVgsCvcTextFieldState inside a composable. Sync the detected brand from your card-number state so length/validation rules adapt automatically:
var cvcState by rememberVgsCvcTextFieldState(
collect = vgsCollect,
fieldName = "data.cvc",
)
LaunchedEffect(cardNumberState.cardBrand) {
cvcState = cvcState.withCardBrand(cardNumberState.cardBrand)
}
VgsCvcOutlinedTextField(
state = cvcState,
onStateChange = { cvcState = it },
)Content copied to clipboard
Useful properties:
cardBrand — brand currently driving CVC length/validation rules.
isValid / validationResult — current validation outcome.
fieldName — JSON key used in the submit payload.
Properties
Link copied to clipboard
Link copied to clipboard
current length of the entered value.
Link copied to clipboard
Link copied to clipboard
optional tokenization settings; when present, the value is tokenized on submit and the token is sent in its place.
Link copied to clipboard
per-validator outcomes for the current value.
Link copied to clipboard
custom validators applied to the value, or null to use the field's default validators.