Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

PinInput

Set length and type. The machine manages focus, paste, completion, and form behavior.

import { PinInput } from '@manti-ui/react';

export default function PinInputBasic() {
  return (
    <PinInput
      label="One-time code"
      length={4}
      type="numeric"
      otp
      variant="primary"
    />
  );
}

Masking

Set mask for secret values.

Sizes

API

PropTypeDefaultDescription
lengthnumber4Number of input cells.
labelReactNodeOptional field label.
size'sm' | 'md' | 'lg''md'Cell size.
variantMantiVariant'primary'Focus-ring variant.
type'alphanumeric' | 'numeric' | 'alphabetic'Allowed character type.
maskbooleanMask entered characters like a password field.
otpbooleanHint the field is a one-time code (sets autocomplete).
valuestring[]Controlled value.
defaultValuestring[]Initial value for uncontrolled usage.
onValueChange(value: string[]) => voidCalled on every change.
onValueComplete(value: string[], valueAsString: string) => voidCalled once every cell is filled.
placeholderstringPlaceholder shown in empty cells.
disabledbooleanDisable the field.
readOnlybooleanMake the field read-only.
invalidbooleanMark the field as invalid.
requiredbooleanMark the field as required.
namestringForm field name.

Styling

Anatomy

PartSelectorDescription
root[data-scope="pin-input"][data-part="root"]The field wrapper.
label[data-scope="pin-input"][data-part="label"]The optional field label.
control[data-scope="pin-input"][data-part="control"]The row that lays out the input cells.
input[data-scope="pin-input"][data-part="input"]Each individual code-entry cell.

Tokens

TokenControls
--manti-pin-input-sizesize

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub