rememberVgsCvcTextFieldState

fun rememberVgsCvcTextFieldState(collect: VGSCollect, fieldName: String, validators: List<VgsTextFieldValidator>? = null, isCardBrandValidationEnabled: Boolean = true, tokenizationConfig: VgsCvcTokenizationConfig? = null): MutableState<VgsCvcTextFieldState>

Creates and remembers a VgsCvcTextFieldState for use with a VgsCvcTextField. This is the only way to obtain an instance — direct construction is internal to the SDK.

var state by rememberVgsCvcTextFieldState(
collect = vgsCollect,
fieldName = "data.cvc",
)

Sync the brand from your card-number state via VgsCvcTextFieldState.withCardBrand so the field's required length adapts (3 digits for most brands, 4 for Amex).

Parameters

collect

the VGSCollect instance the field is bound to.

fieldName

JSON key the value will be sent under by VGSCollect.asyncSubmit.

validators

custom validators. If null, the SDK applies default brand-aware length validation. Pass emptyList() to disable validation.

isCardBrandValidationEnabled

when true, length rules adapt to the currently synced VgsCvcTextFieldState.cardBrand.

tokenizationConfig

optional; when set, the value is tokenized on submit and the token is sent in place of the raw value.