Vgs Expiry Text Field State
Immutable state for a VGS card expiration date field.
Obtain an instance with rememberVgsExpiryTextFieldState inside a composable. The state is replaced (not mutated) on every keystroke; pass the latest instance to your VgsExpiry…TextField and update it from onStateChange:
var state by rememberVgsExpiryTextFieldState(
collect = vgsCollect,
fieldName = "data.expiry",
inputDateFormat = VgsExpiryDateFormat.MonthShortYear,
outputDateFormat = VgsExpiryDateFormat.LongYearMonth,
)
VgsExpiryOutlinedTextField(
state = state,
onStateChange = { state = it },
)Useful properties:
inputDateFormat / outputDateFormat — how the field reads input and serializes for submission.
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.