Pure UI
DocsComponentsBlocksNEW
132

Docs

IntroductionGet Started
Installation
Theming

Components

AccordionAvatarBadgeButtonButton GroupCalendarCardCheckboxCollapsibleCombobox
Detached Triggers
DialogInputInput GroupInput OTPKbdLabelMenuNumber FieldPopoverRadio GroupNEWScroll AreaSelectSeparatorSheetSpinnerSwitchTabsNEWTextareaToastTooltip

Input OTP

Accessible one-time password component with copy paste functionality.

Installation

Loading content...

Usage

<InputOTP maxLength={6}>
  <InputOTPGroup>
    <InputOTPSlot index={0} />
    <InputOTPSlot index={1} />
    <InputOTPSlot index={2} />
  </InputOTPGroup>
  <InputOTPSeparator />
  <InputOTPGroup>
    <InputOTPSlot index={3} />
    <InputOTPSlot index={4} />
    <InputOTPSlot index={5} />
  </InputOTPGroup>
</InputOTP>

Examples

Disabled

Sizes

You can use slotSize prop on InputOTP component to change the size of the input OTP slots. The default size is md.

Variants

You can use variant prop on InputOTP component to change the variant of the input OTP. The default variant is bordered.

Separator

You can use InputOTPSeparator component to add a separator between the input OTP slots.

Patterns

You can use pattern prop on InputOTP component to restrict the input to a specific pattern. It accepts a regular expression string.

Only lowercase letters (a-z):

Only uppercase letters (A-Z):

Numbers only (0-9):

Letters only (a-z, A-Z):

Controlled

Value: