shadcn Input Otp
Draft portable input atoms.
Ordinary demos on this page explicitly use Shadcn Rhea, with matching examples. This does not change public compatibility defaults or imply complete browser, native-host or visual acceptance. Neutral Surface/Text atoms retain their own public semantics; the consumer composition supplies the family presentation theme.
Root owns value/defaultValue, length (1–32, default 6), numeric/alphanumeric filtering, disabled/readOnly, name and ariaLabel. One real Input preserves selection, paste, deletion and composition through TextControl; it requests one-time-code autocomplete. Input commits after composition, strips disallowed characters and bounds length. Slots are passive indexed, aria-hidden readouts; they never create additional editors or tab stops. The active slot is an end-insertion hint, not a claim about the native selection caret. valueChange is a request; completed emits once for each accepted complete code, not an authentication action. Server verification, SMS retrieval and per-cell focus are outside this implementation.
Use Control instead of Input inside Field/FormField to bridge FieldLabel, canonical string validation, IME cancellation, Form serialization and reset. Standalone Input retains its existing naming.
Parts: root, input, control, slot, separator. All four styled families inherit Base behavior.
Draft source work. Full native, assistive-technology, Adapter/Compiler/GPUI, package consumer and independent acceptance remain open. No Finf completion is claimed.
Input OTP is workspace source. There is no public proto-ui add target. Passing value selects controlled mode. Input placeholder is optional and has no default.
| Prop | Type | Default |
|---|---|---|
defaultValue | string | '' |
length | number | 6 |
pattern | 'numeric' 'alphanumeric' | numeric |
disabled | boolean | false |
readOnly | boolean | false |
name | string | '' |
ariaLabel | string | One-time code |
These props belong to Root. Slot defaults index to 0.