Skip to content

    Browse components

    OTP Reels

    A one-time code input where each digit spins in like a slot reel, shakes on a wrong code and glows on success.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/otp-reels

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/otp-reels.json

    Usage

    import { OtpReels } from "@/components/ui/otp-reels";
    
    <OtpReels
      length={6}
      onComplete={async (code) => (await verify(code)).ok}
    />

    Props

    PropTypeDefaultDescription
    lengthnumber6Number of digits.
    successColorstring"#22c55e"Glow color on success.
    errorColorstring"#ef4444"Border color on a wrong code.
    labelstring"Verification code"Accessible label of the input.
    onCompleteReactNode—(code) => boolean | Promise<boolean>. true glows, false shakes and clears.
    onChangeReactNode—Called with the digits typed so far.
    classNamestring—Extra classes for the root element.