Skip to content
Grouped code, light
Light
Grouped code, dark
Dark

Every state

  • Grouped code, default, light
    Grouped code, default, dark

    default

  • Grouped code, focus, light
    Grouped code, focus, dark

    focus

  • Grouped code, partial, light
    Grouped code, partial, dark

    partial

  • Grouped code, filled, light
    Grouped code, filled, dark

    filled

  • Grouped code, error, light
    Grouped code, error, dark

    error

  • Grouped code, disabled, light
    Grouped code, disabled, dark

    disabled

Props

PropTypeDefaultWhat it does
idstring"authenticator-code"Id of the real input; the label, description and error point at it.
namestring"code"Form field name.
labelstring"Authenticator code"Visible label.
descriptionstring–Help text under the code.
groupsnumber[][3, 3]Digits per joined strip; the total is the code length.
defaultValuestring–Starting digits; non-digits are dropped.
errorstring–Error message (e.g. a wrong code); marks both strips and clears once the code is edited.
disabledboolean–Disables the field.
autoFocusboolean–Focuses the code on mount.
onComplete(code: string) => void–Fires once every segment is filled, by typing, paste or autofill.
classNamestring–Extra classes on the outer Field.

More code inputs

All 4
otp-input-01 is in UI ProGet UI Pro, €199

Preview

Open the page
In UI Pro: get it, €199 once

With every block and theme. 400+ buyers since 2020. Plans