Skip to Content
Liquid Glass UI
Components

InputOTP

Apple 27 one-time passcode input with discrete rounded slots, accent focus ring and caret, sized 48×56 on mobile ↔ 34×40 on desktop.

Fully compatible with the standard shadcn/ui JSX API (InputOTP / InputOTPGroup / InputOTPSlot / InputOTPSeparator, built on input-otp):

  • Discrete slots: Each digit renders in its own rounded slot (48×56 / 12px radius on mobile ↔ 34×40 / 8px radius on desktop) sharing Input's surface system.
  • Focus & validation: Active slot displays a 3.5px accent focus ring and accent caret; aria-invalid switches to Apple Red.
  • Default Liquid Glass: Each slot uses the Regular - Small glass material matching Input; pass glass={false} for 100% opaque slots, or nest on a glass surface for automatic Over-Glass flat fills.
apple-liquid-ui/preview/input-otp-demo
MacBook · 16:10

Installation (Shadcn Registry)

npx shadcn@latest add @apple-liquid/input-otp

Usage

import { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/ui/input-otp';

export function Example() {
  return (
    <InputOTP maxLength={4}>
      <InputOTPGroup>
        <InputOTPSlot index={0} />
        <InputOTPSlot index={1} />
        <InputOTPSlot index={2} />
        <InputOTPSlot index={3} />
      </InputOTPGroup>
    </InputOTP>
  );
}

Props API

PropTypeDefaultDescription
glassbooleantrueLiquid Glass control material; false renders 100% opaque Bordered equivalent; auto-switches to Over-Glass on glass surfaces
surface'default' | 'over-glass'Auto-detectedManually override the hosting surface context

On this page