Auth Code Input Showcase

Component Documentation

Component Name

AuthCodeInput

Builder Function Name

create_auth_code_input_manager

Description

renders a 6-digit numeric code input, typically used for one-time passcodes or verification codes

Use like example

Config

PropertyTypeDefaultDescription
valstring

current 6-digit code value

namestring

code

name attribute for the input

is_requiredboolean

false

marks the input as required if true

is_read_onlyboolean

false

makes the input read-only if true

autocompletestring

one-time-code

determines the browser’s autocomplete type

is_validboolean

optionally control or reflect validation state

is_disabledboolean

false

disables the input if true

border_radiusnumber

1

border radius for the input container in rem

mlnumber

0

margin-left in rem

mrnumber

0

margin-right in rem

mtnumber

0

margin-top in rem

mbnumber

0

margin-bottom in rem

on_changefunction

callback invoked when the input value changes, receives the cleaned value

on_sixthfunction

callback invoked when the input reaches 6 digits, receives the final code

Methods

MethodDescriptionParametersReturns
set_val

assigns a new code value to the input, strips non-numeric characters, calls on_change/on_sixth

input: string

void
focus

programmatically focuses the input element

No Params

void

Returned Properties

PropertyTypeDescription
idstring

unique identifier for the code input field

valstring

current stored code value

namestring

name attribute for the input field

is_requiredboolean

true if the input is required

is_read_onlyboolean

true if the code input is read-only

autocompletestring

the browser autocomplete type, often 'one-time-code'

is_validboolean

reflects if the code is currently 6 digits

is_disabledboolean

disables input if true

border_radiusnumber

border radius for the input container in rem

mlnumber

margin-left in rem

mrnumber

margin-right in rem

mtnumber

margin-top in rem

mbnumber

margin-bottom in rem

icon
Sponsored byContibase