Skip to content
Single code field, light
Light
Single code field, dark
Dark

Every state

  • Single code field, default, light
    Single code field, default, dark

    default

  • Single code field, focus, light
    Single code field, focus, dark

    focus

  • Single code field, filled, light
    Single code field, filled, dark

    filled

  • Single code field, verifying, light
    Single code field, verifying, dark

    verifying

  • Single code field, verified, light
    Single code field, verified, dark

    verified

  • Single code field, error, light
    Single code field, error, dark

    error

  • Single code field, disabled, light
    Single code field, disabled, dark

    disabled

Props

PropTypeDefaultWhat it does
idstring"sms-code"Input id; the label, description and message point at it.
namestring"code"Form field name.
labelstring"Code from the text message"Visible label.
descriptionstring–Help text under the field.
lengthnumber6Number of digits.
placeholderstring"000000"Placeholder digits.
defaultValuestring–Starting digits; non-digits are dropped.
verifyLabelstring"Verify"Text on the joined button.
verify(code: string) => Promise<boolean>–Checks the code on the button or Enter; the default accepts 135790 after a short delay.
onComplete(code: string) => void–Fires once the field holds a full code.
status"idle" | "verifying" | "verified" | "error"–Starting state, e.g. a result the server already has.
errorMessagestring"That code is wrong or has expired. Try again or ask for a new one."Message for a wrong code.
disabledboolean–Disables the field and button.
classNamestring–Extra classes on the outer Field.

More code inputs

All 4
otp-input-03 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