Skip to main content
Mantı UI logoMantı UIv0.13.0
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.
labelReactNode—Optional field label.
size'sm' | 'md' | 'lg''md'Cell size.
variantMantiVariant'primary'Focus-ring variant.
type'alphanumeric' | 'numeric' | 'alphabetic'—Allowed character type.
maskboolean—Mask entered characters like a password field.
otpboolean—Hint the field is a one-time code (sets autocomplete).
valuestring[]—Controlled value.
defaultValuestring[]—Initial value for uncontrolled usage.
onValueChange(value: string[]) => void—Called on every change.
onValueComplete(value: string[], valueAsString: string) => void—Called once every cell is filled.
placeholderstring—Placeholder shown in empty cells.
disabledboolean—Disable the field.
readOnlyboolean—Make the field read-only.
invalidboolean—Mark the field as invalid.
requiredboolean—Mark the field as required.
namestring—Form 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