Free
Pro

OTP Input

A one-time password / PIN input with individually-focusable boxes. Supports auto-advance on type, keyboard navigation, paste, and Angular Forms integration. Emits (completed) when all boxes are filled.

freenew

Playground

6

HTML

<ply-otp-input [length]="6">Otp Input</ply-otp-input>

6-Digit OTP

Default configuration with length="6" and numbersOnly="true".

Current value:

4-Digit PIN

Masked (Password)

Set [mask]="true" to hide the digits as password dots.

Disabled State

Installation

Run the following command to add this component to your project:

bash

npx ply-ui-cli add otp-input

API Reference

For AI agents

Copy a prompt with the registry name, CLI install, and import — or add the Ply MCP server.

bash

npx -y ply-ui-mcp

Ply provides standalone components. Import the exact elements you want to use into your component.

typescript (Example)

// Install: npx ply-ui-cli add otp-input
// Paths are relative to aliases.components (default: src/app/components)
import { OtpInputComponent } from './otp-input/otp-input.component';

@Component({
  selector: 'app-your-component',
  imports: [
    OtpInputComponent
  ],
  template: `...`
})
export class YourComponent {}

API for otp-input — generated from JSDoc in the library source.

API reference for otp-input
APIMemberTypeDefaultDescription
ply-otp-inputclassstring''Additional host CSS classes (merged via cn()).
ply-otp-inputlengthnumber6
ply-otp-inputmaskbooleanfalse
ply-otp-inputnumbersOnlybooleantrue
ply-otp-input(completed)stringEmitted when all boxes are filled with the full code string.
ply-otp-inputdisabledbooleanfalseWhether the control is disabled (consumer-facing input).