About
A 4-digit OTP input that folds into a square, joins into one tile and turns into a check mark. Paste, autofill, keyboard and error state. SMS fill, resend timer and sounds in the full version: codeandchill.store/components/quarto?utm_source=21st
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Quarto — Animated OTP Input (Verification Code) to your project and fits it to your theme.
Code
How Quarto — Animated OTP Input (Verification Code) is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import { useEffect, useState } from "react";
import QuartoOtpField from "@/components/ui/quarto-otp-input";
const settings = {
demoCode: "8402",
destination: "+1 415 ••• 0142",
checkMs: 620,
};
/** Quarto always opens dark, then follows the page's `dark` class only when it changes. */
function usePageTheme() {
const [theme, setTheme] = useState<"dark" | "light">("dark");
useEffect(() => {
const html = document.documentElement;
let last = html.classList.contains("dark");
const mo = new MutationObserver(() => {
const now = html.classList.contains("dark");
if (now !== last) { last = now; setTheme(now ? "dark" : "light"); }
});
mo.observe(html, { attributes: true, attributeFilter: ["class"] });
return () => mo.disconnect();
}, []);
return theme;
}
export default function Demo(props: Partial<typeof settings> = {}) {
const s = { ...settings, ...props };
const theme = usePageTheme();
return (
<div
className="flex min-h-[100dvh] w-full items-center justify-center overflow-x-hidden px-5 py-10"
style={{
background: theme === "dark"
? "radial-gradient(70% 40% at 50% 0%, rgba(106,92,255,0.13), transparent 68%), radial-gradient(90% 55% at 50% 110%, rgba(47,227,155,0.05), transparent 64%), linear-gradient(180deg, #0e1017, #08090d 55%)"
: "radial-gradient(70% 40% at 50% 0%, rgba(106,92,255,0.12), transparent 68%), radial-gradient(90% 55% at 50% 110%, rgba(15,174,116,0.07), transparent 64%), linear-gradient(180deg, #f3f3fb, #e8eaf3 55%)",
}}
>
<QuartoOtpField
demoCode={s.demoCode}
destination={s.destination}
checkMs={s.checkMs}
theme={theme}
/>
</div>
);
}
















