Diwa Design System

Pin Code

A segmented code entry field with automatic focus advancement. Used for OTP, verification codes, and PINs.

Properties

NameTypeDefaultDescription
labelstring''Visible label text.
descriptionstring''Supplementary description below the label.
state'none' | 'error' | 'success''none'Validation state.
messagestring''Feedback message for error or success state.
lengthnumber4Number of input boxes (1–6).
valuestring''Current value string. Pre-fills the boxes.
type'number' | 'password''number'"number" restricts to digits and shows numeric keyboard on mobile; "password" masks the input.
requiredbooleanfalseWhether the field is required.
disabledbooleanfalseDisables all boxes.
compactbooleanfalseEnables dense mode with smaller boxes.
hideLabelbooleanfalseHides the visible label.
theme'dark' | 'light''dark'Per-component theme override.

Events

NameDetail typeBubblesDescription
update{ value: string; isComplete: boolean }NoEmitted whenever any box value changes. isComplete is true when all boxes are filled.

Slots

diwa-pin-code uses no slots.