logo

Input

One-time Code

单个隐形输入承载 4 或 6 位验证码,光标逐格弹性滑动;填满后正确则细胞融合成 Verified 胶囊,错误则整行抖动并自右向左坠落。

Code

"use client";

import Otp from "./otp";

/**
 * Gallery shell for the OTP block. Bencho's default is a four-digit code with
 * the "Accept" answer; the parameter controls are intentionally omitted so the
 * component is shown on its own.
 */
export default function Demo() {
  return (
    <div className="flex w-full flex-col items-center">
      <Otp length={4} answer="Accept" corner={12} />
    </div>
  );
}