PinInput

PinInput is a component used to capture pin codes or OTP (One-Time Password) inputs.

Usage

import { PinInput } from "@yamada-ui/react"
<PinInput.Root />

Change Variant

Change Size

Change Color Scheme

Set Default Value

To set a default value, set a string to defaultValue.

Change Placeholder

To change the placeholder, set a string to placeholder.

Change Number of Fields

To change the number of fields, set a number to items.

Change Type

By default, only numeric input is allowed. To support alphanumeric, set type to alphanumeric.

Use as One-Time Password

To use as a one-time password (autocomplete="one-time-code"), set otp to true.

Mask Entered Value

To mask the entered value, set mask to true.

Disabled

To disable the input, set disabled to true.

Read-Only

To make read-only, set readOnly to true.

Invalid

To make invalid, set invalid to true.

Change Border Color

To change the border color, set focusBorderColor or errorBorderColor to the color.

Set Action on Completion

To set the action on completion, use the onComplete property.

Disable Focus Management

By default, when a field is entered, the focus automatically moves to the next field. Also, when the BackSpace key is pressed, the focus moves to the previous field. To disable this control, set manageFocus to false.

Customize Field

Control

Props

Accessibility

Currently, this section is being updated due to the migration of v2.