Vgs Card Number Text Field State
Immutable state for a VGS card number field.
Obtain an instance with rememberVgsCardNumberTextFieldState inside a composable. The state is replaced (not mutated) on every keystroke; pass the latest instance to your VgsCardNumber…TextField and update it from the widget's onStateChange:
var state by rememberVgsCardNumberTextFieldState(
collect = vgsCollect,
fieldName = "data.card_number",
)
VgsCardNumberOutlinedTextField(
state = state,
onStateChange = { state = it },
)Useful properties:
cardBrand — detected brand for the current input.
bin / last4 — non-sensitive metadata, populated only when isValid.
isValid / validationResult — current validation outcome.
fieldName — JSON key used in the submit payload.
Properties
current length of the entered value.
optional tokenization settings; when present, the value is tokenized on submit and the token is sent in its place.
per-validator outcomes for the current value.
custom validators applied to the value, or null to use the field's default validators.