Measured entry

shadcn-input-otp

inputunclassified

A client-side React wrapper that renders segmented one-time-code entry with grouped slots, an active caret, and an optional separator. It ships as source copied from the shadcn registry and composes input-otp, a Lucide icon, Tailwind utilities, and the cn helper backed by clsx and tailwind-merge.

Specimen
Harness screenshot of shadcn-input-otp at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of shadcn-input-otp at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of shadcn-input-otp at 1440 pixels wide
Harness screenshot at 1440 pixels wide. No horizontal overflow recorded.

Measured

Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.

Harness measurements recorded for shadcn-input-otp
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical1
Axe serious0
Axe moderate0
Axe minor0
Gzip marginal34.0 KB (99.5 KB build, 65.5 KB baseline)
Bare modeFAIL
Provider requiredNO
Demo usedwritten from the component source API

What the harness recorded

BARE BUILD

✗ Build failed in 665ms
error during build:
[vite]: Rollup failed to resolve import "lucide-react" from "<sandbox>re-8b6a2432a49e/src/cut/components/ui/input-otp.tsx".

Verdict

A practical, compact adapter for teams that already like the shadcn source-copy model. It builds and mounts cleanly across the tested layouts, but the supplied demo has a critical labeling failure, so add an explicit accessible name before shipping it.

Use it if

  • You need a controlled verification-code field with individually styled slots.
  • Your React interface already uses Tailwind utilities and can supply an accessible label.
  • You want slot grouping and separators while retaining the input-otp interaction model.

Skip it if

  • You want a plain text field without the extra dependency and segmented-slot behavior.
  • Your project does not use React or cannot support client-side components.
  • You need a drop-in example with an accessible name already wired, because the supplied demo leaves the form control unlabeled.

Install

Installation record for shadcn-input-otp
Declared dependenciesinput-otp, clsx, tailwind-merge
Missing on installnone
Bare installfails once the shadcn-style helpers are removed, so it needs that setup
Providerno provider required in the harness

In a non-shadcn project, add input-otp, lucide-react, clsx, and tailwind-merge; provide the cn helper, Tailwind theme tokens used by the classes, and the caret-blink animation. Mark the module for client rendering where your framework requires it, and connect a visible label or accessible name.

Source and credit

This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.

Author repository

github.com/shadcn-ui/ui
License
MIT
Record published
2026-08-16

Alternatives

Other published entries for the input pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.