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-invalidswitches to Apple Red. - Default Liquid Glass: Each slot uses the
Regular - Smallglass material matchingInput; passglass={false}for 100% opaque slots, or nest on a glass surface for automatic Over-Glass flat fills.
Installation (Shadcn Registry)
npx shadcn@latest add @apple-liquid/input-otpUsage
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
| Prop | Type | Default | Description |
|---|---|---|---|
glass | boolean | true | Liquid Glass control material; false renders 100% opaque Bordered equivalent; auto-switches to Over-Glass on glass surfaces |
surface | 'default' | 'over-glass' | Auto-detected | Manually override the hosting surface context |
InputGroup
Apple 27 Text Fields-compliant composite input uniting search bars, address bars, and message composers in one capsule surface with default Liquid Glass and automatic Over-Glass switching.
Item
Apple 27 list row cell inspired by iOS Settings rows, combining icons, titles, descriptions, and trailing controls with Inset Grouped styling and link press feedback.