remember Vgs Text Field State
fun rememberVgsTextFieldState(collect: VGSCollect, fieldName: String, validators: List<VgsTextFieldValidator>? = null, tokenizationConfig: VgsTextFieldTokenizationConfig? = null): MutableState<VgsTextFieldState>
Creates and remembers a VgsTextFieldState for use with a VgsTextField. This is the only way to obtain an instance — direct construction is internal to the SDK.
var state by rememberVgsTextFieldState(
collect = vgsCollect,
fieldName = "data.city",
)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, a default required-field validator is applied. Pass emptyList() to disable validation.
tokenization Config
optional; when set, the value is tokenized on submit and the token is sent in place of the raw text.