remember Vgs Expiry Text Field State
fun rememberVgsExpiryTextFieldState(collect: VGSCollect, fieldName: String, validators: List<VgsTextFieldValidator>? = null, inputDateFormat: VgsExpiryDateFormat = VgsExpiryDateFormat.MonthShortYear, outputDateFormat: VgsExpiryDateFormat = VgsExpiryDateFormat.MonthShortYear, serializer: VgsExpirySerializer? = null, tokenizationConfig: VgsExpiryTokenizationConfig? = null): MutableState<VgsExpiryTextFieldState>
Creates and remembers a VgsExpiryTextFieldState for use with a VgsExpiryTextField. This is the only way to obtain an instance — direct construction is internal to the SDK.
var state by rememberVgsExpiryTextFieldState(
collect = vgsCollect,
fieldName = "data.expiry",
)Content copied to clipboard
Parameters
collect
the VGSCollect instance the field is bound to.
field Name
JSON key the value will be sent under by VGSCollect.asyncSubmit.
validators
custom validators. If null, default required + min/max date validation applies. Pass emptyList() to disable validation.
input Date Format
the format the user types in. Defaults to VgsExpiryDateFormat.MonthShortYear (MM/YY).
output Date Format
the format used on submit. Defaults to VgsExpiryDateFormat.MonthShortYear (MM/YY).
serializer
optional; splits the date into separate month/year JSON fields on submit.
tokenization Config
optional; when set, the value is tokenized on submit and the token is sent in place of the raw value.