OTPInput
Represents the KendoVue OTPInput component. Use the OTPInput to let the user type a one-time password, one character per cell.
Definition
Package:@progress/kendo-vue-inputs
Properties Interface:OTPInputProps
Syntax:
<OTPInput :length="6" :type="'number'" :group-length="3" :separator="'-'" />
Properties
ariaDescribedBy?
string
Sets the aria-describedby attribute on the OTPInput wrapper element.
ariaLabel?
string
Sets the aria-label attribute on the OTPInput wrapper element.
ariaLabelledBy?
string
Sets the aria-labelledby attribute on the OTPInput wrapper element.
defaultValue?
string
Sets the initial value of the OTPInput when you do not set value.
The OTPInput then handles the next updates on its own.
dir?
"ltr" | "rtl"
Sets the text direction of the OTPInput.
The available options are:
'ltr'— left-to-right (default)'rtl'— right-to-left
When you set it to 'rtl', the Arrow Left and Arrow Right keys move the focus in the reverse direction.
disabled?
boolean
Sets whether the OTPInput is disabled. A disabled OTPInput does not respond to the user
and gets the k-disabled CSS class.
false
fillMode?
"flat" | "solid" | "outline"
Sets the fill mode of the OTPInput. The fill mode controls the background and the border.
The available options are:
'solid''flat''outline'
groupLength?
number | number[]
Sets the length of each group of input cells.
- Pass a
numberto give all groups the same length. - Pass a
number[]to give each group its own length.
The sum of all group lengths must equal length.
id?
string
Sets the id attribute on the OTPInput wrapper element.
inputAttributes?
Object
Sets additional HTML attributes on every inner <input> element.
You cannot override the attributes that the OTPInput needs to work.
length?
number
Sets the total number of input cells.
4
modelValue?
string
Sets the current value of the OTPInput when you use v-model.
For two-way binding, v-model is simpler than value with @change.
name?
string
Sets the name attribute that the OTPInput uses in an HTML form.
The OTPInput renders a hidden <input> with this name and the current value,
so the native form can submit it.
onBlur?
(event: OTPInputBlurEvent) => void
Fires when the whole OTPInput loses the focus. The event name is blur.
It does not fire when the focus moves between the cells.
onChange?
(event: OTPInputChangeEvent) => void
Fires when the user changes the value of any input cell. The event name is change.
onFocus?
(event: OTPInputFocusEvent) => void
Fires when any input cell gets the focus. The event name is focus.
placeholder?
string
Sets a placeholder character that each empty input cell shows.
readOnly?
boolean
Sets whether the OTPInput is read-only.
false
required?
boolean
Sets whether the field is required for HTML5 constraint validation.
false
rounded?
"small" | "medium" | "large" | "none" | "full"
Sets the border radius of the OTPInput.
The available options are:
'small''medium''large''full''none'
separator?
string | OTPSeparatorIcon
Sets the separator between the groups of input cells.
It works only when you set groupLength.
- Pass a
stringto render a text separator. - Pass an
OTPSeparatorIconto render an icon separator.
size?
"small" | "medium" | "large"
Sets the size of the OTPInput.
The available options are:
'small''medium''large'
spacing?
boolean
Sets whether the input cells render as separate boxes with space
between them. When you set it to false, the cells render joined together.
true
Sets the type of the input cells.
'text'
valid?
boolean
Sets the validity of the OTPInput. When you set it to false, the OTPInput shows its invalid state.
value?
string
Sets the current value of the OTPInput. Use it to control the value.
A space (' ') marks each empty input cell.
References
Represents the ref of the Kendo UI for Vue OTPInput component.