Code And Chill

Sigil — Animated OTP Input (Verification Code)

Forms 8

About

OTP field that seals itself: digits roll in, a light scans the row, then the cells fuse into a verified seal. Type or paste. SMS fill, resend timer and error recovery in the full version: codeandchill.store/components/sigil?utm_source=21st

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Sigil — Animated OTP Input (Verification Code) to your project and fits it to your theme.

Code

How Sigil — 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 SigilOtpField from "@/components/ui/sigil-otp-field";

const settings = {
  length: 4,
  demoCode: "4190",
  destination: "+1 415 ••• 0142",
};

/** Opens dark (Sigil's own look), then follows the page's `dark` class only when it changes. */
function usePageDark() {
  const [dark, setDark] = useState(true);
  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; setDark(now); }
    });
    mo.observe(html, { attributes: true, attributeFilter: ["class"] });
    return () => mo.disconnect();
  }, []);
  return dark;
}

export default function Demo(props: Partial<typeof settings> = {}) {
  const s = { ...settings, ...props };
  const dark = usePageDark();
  return (
    <div
      className="flex min-h-[100dvh] w-full items-center justify-center overflow-x-hidden px-5 py-10"
      style={{
        background: dark
          ? "radial-gradient(78% 46% at 50% 8%, rgba(139,92,246,0.16), transparent 68%), radial-gradient(96% 60% at 50% 112%, rgba(31,224,200,0.07), transparent 64%), linear-gradient(180deg, #0b0e1a, #06070d 62%)"
          : "radial-gradient(78% 46% at 50% 8%, rgba(139,92,246,0.14), transparent 68%), radial-gradient(96% 60% at 50% 112%, rgba(16,179,160,0.08), transparent 64%), linear-gradient(180deg, #f3f2fb, #e9ebf5 62%)",
      }}
    >
      <SigilOtpField
        length={s.length === 6 ? 6 : 4}
        demoCode={s.demoCode}
        destination={s.destination}
        theme={dark ? "dark" : "light"}
      />
    </div>
  );
}

Dependencies

More by Code And Chill

View all
  • Fernly — Project Management Dashboard with Kanban

    Fernly — Project Management Dashboard with Kanban

    748
  • Corbel — Sales Analytics Dashboard

    Corbel — Sales Analytics Dashboard

    439
  • Hovira — Glassmorphism Smart Home Dashboard

    Hovira — Glassmorphism Smart Home Dashboard

    87
  • Vitra — Glass Pricing Section

    Vitra — Glass Pricing Section

    79
  • Halden — CRM Dashboard with Sales Pipeline

    Halden — CRM Dashboard with Sales Pipeline

    64
  • Kestrel — Marketing Analytics Dashboard

    Kestrel — Marketing Analytics Dashboard

    44
  • Money River — Sankey Money Flow Chart

    Money River — Sankey Money Flow Chart

    41
  • Meniscus — Liquid Bottom Navigation Bar

    Meniscus — Liquid Bottom Navigation Bar

    33

More in Forms

View all
  • Form

    Form

    7
  • Login 2

    Login 2

    16
  • Contact Form

    Contact Form

    33
  • Contact Card

    Contact Card

    1.1K
  • Book A Demo 1

    Book A Demo 1

    95
  • Premium Auth

    Premium Auth

    613
  • Onboarding Stepper

    Onboarding Stepper

    13
  • Authentication Card

    Authentication Card

    52