Code And Chill

Sigil OTP Field

Forms

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 OTP Field to your project and fits it to your theme.

Code

How Sigil OTP Field 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
  • Money River

    Money River

    9
  • Fernly Project Dashboard

    Fernly Project Dashboard

    8
  • Glass Smart Home Dashboard

    Glass Smart Home Dashboard

    7
  • Tide Download Button

    Tide Download Button

    2
  • Gulp Delete Button

    Gulp Delete Button

  • Parachute Download Button

    Parachute Download Button

  • Corbel Sales Dashboard

    Corbel Sales Dashboard

  • Kairo Revenue Analytics

    Kairo Revenue Analytics

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19