Skip to content
Browse documentation

Wrap any dangerous button. A padlock on its corner shows how long you stay verified; when it’s locked, the button grows right where it stands into the “Confirm it’s you” card.

Used forDanger zonesSecretsAccount securityMoney

Install with the shadcn CLI

$ npx shadcn@latest add https://hairlineui.com/r/sudo-gate.json

Registered the namespace? Then it’s shadcn add @hairline/sudo-gate. Set it up

Templates

Need the whole page?

63 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $159, and 8 are free.

All 63 templates

Where it’s used

  • Danger zones

    Delete an account, transfer ownership or close a workspace.

  • Secrets

    Reveal or roll an API key, a webhook secret or recovery codes.

  • Account security

    Change the email or password, turn off two-factor, remove a passkey.

  • Money

    Change the payout account, raise a spending limit or issue a refund.

What it handles for you

Step-up auth usually arrives as a modal out of nowhere, and nobody can tell when it will ask again. The gate shows the trust window on the button, and the question grows out of the button you pressed, right where it is.

Instead of wiring upa reauthentication modalfresh-session checks in the clienta countdown timerpasskey, code and password formsretrying the original click
  1. You can see the window

    An open padlock and a draining ring say you’re verified and for how long; a shut one says the next click will ask.

  2. The button becomes the question

    The locked button grows in place into the card that asks, and folds back into the same button; nothing pops up over the page and you never lose track of what asked.

  3. Your click still happens

    Once you’re verified, the gate clicks the app’s own button for you, so its handler, form or link runs as if nothing stopped it.

  4. Three ways in

    Passkey, a one-time code (sent as the view opens, with autofill, paste and a resend clock) or a password, in the order you list.

  5. One window per session

    Gates in the same scope share the trust: verify once and every badge on the page fills. expireSudo() locks them all.

  6. Your auth, your server

    It only calls verify and sendCode. Errors you throw show in the card; the server stays the judge of freshness.

Overview

Apps ask you to sign in again before deleting an account, showing a key or changing an email, and the usual way is a modal that comes out of nowhere, every time. Sudo gate makes that window visible. A small padlock sits on the button’s corner: open, inside a ring of the time you have left (“8 min”, then “42s” in amber), or shut once it runs out. Click a locked button and it grows where it stands: the button itself widens and deepens into the card that asks (a passkey, a code or a password), pushing what’s around it aside, its label giving way to the question. Verify, and the big padlock swings open; the card folds back down into the button with the small padlock riding its corner, its ring filling, and your click goes through to the app’s own handler. Every gate on the page shares one trust window, so one verification unlocks them all.

States

locked
The badge is a round padlock with its shackle down and no ring. A click on the button is held and the button goes to ask.
asking
The button grows in place from its own size, colour and radius to a 360px card (the screen less 16px a side on phones) over 520ms, its height measured from the content, so the layout around it makes room. Its label fades within 140ms and the question rises out of a 6px blur from 150ms. Escape, the cross, a press elsewhere or focus leaving folds it back.
verifying
The method’s button turns into a spinner (“Waiting for your passkey”, “Checking”); a code row sweeps with light. A thrown error says why under it, and a wrong code shakes and clears.
unlocked
The big padlock swings open on its right leg as its ring fills green. 760ms later the card folds back into the button over 440ms, the label returning as it lands, while the small padlock rides its corner with its ring filling; the click goes through once the button is back.
trusted
The badge shows the time left: whole minutes rolling down, then seconds in the last minute with the ring turning amber. The ring drains in one long animation; the clock re-renders once a second only while trusted.
expired
The text folds away, the ring empties and the shackle drops shut. Other gates in the scope fill up over 600ms when any one of them is verified.

Usage

usage.tsx
import { SudoGate } from "@/components/sudo-gate";<SudoGate  verify={async (proof) => { /* check it with your auth, throw if it fails */ }}  reason="Deleting your account needs a recent sign-in.">  <Button variant="destructive" onClick={deleteAccount}>Delete account</Button></SudoGate>

Depends on lucide-react, installed for you by the CLI along with the keyframes it needs.

Works with

With Better Auth or Clerk

Better Auth’s deleteUser() needs a fresh session (its createdAt within session.freshAge) when no password is sent, so the gate signs you in again (passkey or email code) right before the delete runs. Clerk lets a sensitive action through for 10 minutes after a verification and runs it from session.startVerification. Either way, your server still checks before it acts.

example.tsx
"use client";import { SudoGate } from "@/components/sudo-gate";import { authClient } from "@/lib/auth-client"; // Better Auth with the passkey and emailOTP client pluginsconst FRESH_AGE = 60 * 10; // the same as session.freshAge in your betterAuth() configexport function DeleteAccount() {  const { data } = authClient.useSession();  if (!data) return null;  const email = data.user.email;  return (    <SudoGate      freshUntil={new Date(data.session.createdAt).getTime() + FRESH_AGE * 1000}      trustFor={FRESH_AGE}      methods={["passkey", "code"]}      codeHint={email}      reason="Deleting your account needs a recent sign-in."      sendCode={async () => {        const { error } = await authClient.emailOtp.sendVerificationOtp({ email, type: "sign-in" });        if (error) throw new Error(error.message);      }}      verify={async (proof) => {        const { error } =          proof.method === "passkey"            ? await authClient.signIn.passkey()            : proof.method === "code"              ? await authClient.signIn.emailOtp({ email, otp: proof.code })              : await authClient.signIn.email({ email, password: proof.password });        if (error) throw new Error(error.message);      }}    >      {/* Runs once you're verified: the session is fresh, so Better Auth lets the delete through. */}      <button        onClick={async () => {          const { error } = await authClient.deleteUser();          if (error) alert(error.message);        }}      >        Delete account      </button>    </SudoGate>  );}// Clerk: verify with a code through the session's own verification.//   const { session } = useSession();//   sendCode={async () => {//     const v = await session!.startVerification({ level: "first_factor" });//     const factor = v.supportedFirstFactors?.find((f) => f.strategy === "email_code");//     await session!.prepareFirstFactorVerification({ strategy: "email_code", emailAddressId: factor!.emailAddressId });//   }}//   verify={async (proof) => {//     if (proof.method !== "code") throw new Error("Use the code we sent you.");//     await session!.attemptFirstFactorVerification({ strategy: "email_code", code: proof.code });//   }}//   methods={["code"]} trustFor={600}// On the server: if (!has({ reverification: "strict" })) return reverificationErrorResponse("strict");

Props

children
ReactElement
The app’s own button or link. Its click is held until you’re verified, then the gate clicks it for you.
verify
(proof: SudoProof) => Promise<unknown>
Checks { method: "passkey" }, { method: "code", code } or { method: "password", password }. Resolve to unlock, optionally with a Date or ms for when the trust ends; throw an Error to show its message.
freshUntil
Date | number | null
When the current trust ends, from your session. Leave out to start locked.
trustFor= 600
number
Seconds a verification lasts when verify doesn’t say, and the full length of the ring.
methods= ["passkey", "code"]
("passkey" | "code" | "password")[]
The ways in, first one shown first; the rest are links under it.
sendCode
() => Promise<unknown>
Sends the one-time code. Runs as the code view opens and on resend; throw to show why it failed.
codeHint
string
Where the code went, shown in its label.
reason= "This action needs a recent sign-in."
string
Why this button asks, under “Confirm it’s you”.
scope= "session"
string
Gates with the same scope share one trust window.
badge= true
boolean
Shows the padlock on the button’s corner.
expireSudo(scope?)
function
Exported: locks every gate in a scope, e.g. when your server answers that the session isn’t fresh, or on sign-out.

Accessibility and motion

  • The gate holds the click in the capture phase (preventDefault and stopPropagation), so a form doesn’t submit and a link doesn’t navigate until you’re verified. Enter and Space on the button work the same way.
  • The button gets an aria-describedby saying whether it will ask. The card is a group labelled by its title; focus moves into it as it opens and back to the button on Escape or the cross.
  • “Verified. Unlocked for N minutes.” is announced once from a status region outside the button; the ticking time on the badge is hidden from screen readers.
  • The card takes the button’s place in the layout, so whatever sits beside or under the button moves to make room and moves back when it folds. Give the button a parent that can grow.
  • Reduced motion: the card appears and goes at once without growing, and the shackle changes in place. The ring still drains, since it carries the information.
  • This is the client half. The server must still refuse the action when the session isn’t fresh; call expireSudo() when it does, and the next click asks.

Requirements

React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.

The CLI also installs Code input, Status button, Text morph, Number roll.

Source

"use client";import * as React from "react";import { NumberRoll } from "./number-roll";import { SudoGateMark } from "./sudo-gate-mark";import { SudoGatePanel, type SudoMethod, type SudoProof } from "./sudo-gate-panel";import { TextMorph } from "./text-morph";export type { SudoMethod, SudoProof } from "./sudo-gate-panel";/* ───────────────────────────────────────────────────────── * SUDO GATE: a dangerous button that knows if you're still you * *   badge     a small padlock sits on the button's corner. While *             you're recently verified it's open, inside a ring of *             the time left ("8 min", then "42s", the last minute *             amber); when the time is up the shackle drops shut *   ask       click a locked button and it grows where it stands: *             the button itself widens and deepens into the card *             "Confirm it's you", pushing what's around it aside, *             its label giving way to the question *   unlock    the big padlock swings open, the card folds back down *             into the button with the small padlock riding its *             corner, its ring filling, and your click goes through *   share     every gate on the page shares one trust window: verify *             once and every other badge fills up too * * Wrap the app's own button. The gate stops its click until you're * verified, then clicks it for you; the button, its handler and the * request stay the app's. Always check freshness on the server too. * ───────────────────────────────────────────────────────── */export interface SudoGateProps {  /** The app's own button (or link). Its click is held until you're verified. */  children: React.ReactElement<{ "aria-describedby"?: string }>;  /** Checks the proof with your auth. Resolve to unlock (optionally with when the trust ends, as a Date or ms); throw to say why not. */  verify: (proof: SudoProof) => Promise<unknown>;  /** When the current trust ends, from your session (e.g. createdAt + freshAge). Leave out to start locked. */  freshUntil?: Date | number | null;  /** How long a verification lasts, in seconds, when verify doesn't say. */  trustFor?: number;  /** The ways to verify, first one shown first. */  methods?: SudoMethod[];  /** Sends the one-time code; called as the code view opens and on resend. */  sendCode?: () => Promise<unknown>;  /** Where the code went, e.g. "mira@northwind.com". */  codeHint?: string;  /** Why this action asks, shown under "Confirm it's you". */  reason?: string;  /** Gates with the same scope share one trust window. */  scope?: string;  /** Hide the corner badge (the gate still asks). */  badge?: boolean;  className?: string;}/* ── One trust window per scope, shared by every gate on the page ── */const trust = new Map<string, number>();// When each window was set, so a badge whose clock last ticked before it never counts from a stale time.const setAt = new Map<string, number>();const listeners = new Set<() => void>();function setTrust(scope: string, until: number) {  if (trust.get(scope) === until) return;  trust.set(scope, until);  setAt.set(scope, Date.now());  listeners.forEach((l) => l());}const subscribeTrust = (l: () => void) => {  listeners.add(l);  return () => {    listeners.delete(l);  };};/** Locks every gate in a scope now, e.g. when your server answers that the session isn't fresh, or on sign-out. */export function expireSudo(scope = "session") {  setTrust(scope, 0);}const toMs = (v: Date | number) => (typeof v === "number" ? v : v.getTime());const reducedQuery = "(prefers-reduced-motion: reduce)";const subscribeReduced = (onChange: () => void) => {  const query = window.matchMedia(reducedQuery);  query.addEventListener("change", onChange);  return () => query.removeEventListener("change", onChange);};const useReducedMotion = () =>  React.useSyncExternalStore(subscribeReduced, () => window.matchMedia(reducedQuery).matches, () => false);const EASE = "cubic-bezier(0.16,1,0.3,1)";const GROW = 520;const FOLD = 440;const CARD_W = 360;const RADIUS = 22;const METHODS: SudoMethod[] = ["passkey", "code"];/** The button's size and look, so the card can start and end as it. */interface Origin {  width: number;  height: number;  radius: number;  bg: string;}function originOf(target: HTMLElement): Origin {  const style = getComputedStyle(target);  const transparent = /rgba?\(\s*0,\s*0,\s*0,\s*0\s*\)|transparent/.test(style.backgroundColor);  return {    width: target.offsetWidth,    height: target.offsetHeight,    radius: Math.min(parseFloat(style.borderTopLeftRadius) || 0, target.offsetHeight / 2),    bg: transparent ? "var(--background)" : style.backgroundColor,  };}/** The padlock on the button's corner. It owns the per-second clock, so the app's button never re-renders with it. */function Badge({  until,  since,  trustFor,  reduced,  hidden,  ringRef,  landedRef,}: {  until: number;  since: number;  trustFor: number;  reduced: boolean;  hidden: boolean;  ringRef: React.RefObject<HTMLSpanElement | null>;  landedRef: React.RefObject<boolean>;}) {  const [now, setNow] = React.useState<number | null>(null);  const arcRef = React.useRef<SVGCircleElement>(null);  // Wakes once a second, on the second, only while trusted.  React.useEffect(() => {    const t0 = Date.now();    const delay = now === null ? 0 : until > t0 ? 1000 - (t0 % 1000) + 5 : -1;    if (delay < 0) return;    const t = window.setTimeout(() => setNow(Date.now()), delay);    return () => window.clearTimeout(t);  }, [now, until]);  const left = now === null ? 0 : Math.max(0, until - Math.max(now, since));  const fresh = left > 0;  const secs = Math.ceil(left / 1000);  const ending = fresh && secs < 60;  const shown = ending ? { n: secs, unit: "s" } : { n: Math.ceil(secs / 60), unit: "min" };  // The ring drains in one long animation; a new window fills it first (other gates), or starts it full (the one you just unlocked).  React.useLayoutEffect(() => {    const arc = arcRef.current;    if (!arc) return;    const read = parseFloat(getComputedStyle(arc).strokeDashoffset);    const current = Number.isNaN(read) ? 1 : read;    arc.getAnimations().forEach((a) => a.cancel());    if (!fresh) {      if (current < 1 && !reduced) arc.animate([{ strokeDashoffset: current }, { strokeDashoffset: 1 }], { duration: 300, easing: EASE });      return;    }    const rest = until - Date.now();    const from = 1 - Math.min(1, rest / (trustFor * 1000));    const fill = landedRef.current || reduced ? 0 : 600;    landedRef.current = false;    arc.animate(      fill        ? [{ strokeDashoffset: current, easing: EASE }, { strokeDashoffset: from, offset: fill / (fill + rest), easing: "linear" }, { strokeDashoffset: 1 }]        : [{ strokeDashoffset: from }, { strokeDashoffset: 1 }],      { duration: fill + rest, fill: "forwards" },    );  }, [fresh, until, trustFor, reduced, landedRef]);  return (    <span      aria-hidden="true"      className="pointer-events-none absolute -top-[11px] right-2.5 z-[1] flex h-[22px] items-center rounded-full bg-background p-px shadow-[0_0_0_1px_var(--border)]"      // While the button is open as the card, its padlock is the big one inside; the badge comes back as the card folds.      style={{ opacity: hidden ? 0 : 1, transition: reduced ? "none" : `opacity ${hidden ? 120 : 240}ms ${EASE}` }}    >      {/* The time sits to the padlock's left and folds toward it, so the padlock never moves off its corner. */}      <span        className="grid"        style={{          gridTemplateColumns: fresh ? "1fr" : "0fr",          opacity: fresh ? 1 : 0,          filter: fresh || reduced ? "none" : "blur(3px)",          transition: reduced ? "none" : `grid-template-columns 420ms ${EASE}, opacity ${fresh ? 320 : 160}ms ${EASE}, filter 320ms ${EASE}`,        }}      >        <span className="flex min-w-0 justify-end [clip-path:inset(-2px_0_-2px_0)]">          <span className="flex w-max items-center pl-[7px] pr-[3px] text-[11px] font-medium leading-[14px] tabular-nums text-foreground">            <NumberRoll value={shown.n} direction="down" duration={700} />            <TextMorph className={shown.unit === "min" ? "ml-[2px]" : ""}>{shown.unit}</TextMorph>          </span>        </span>      </span>      <span ref={ringRef} className="block size-5 shrink-0">        <SudoGateMark open={fresh} ending={ending} reduced={reduced} arcRef={arcRef} className="size-5" />      </span>    </span>  );}export function SudoGate({  children,  verify,  freshUntil,  trustFor = 600,  methods = METHODS,  sendCode,  codeHint,  reason = "This action needs a recent sign-in.",  scope = "session",  badge = true,  className = "",}: SudoGateProps) {  const reduced = useReducedMotion();  const until = React.useSyncExternalStore(subscribeTrust, () => trust.get(scope) ?? 0, () => 0);  const [now, setNow] = React.useState<number | null>(null);  const [phase, setPhase] = React.useState<"closed" | "opening" | "open" | "closing">("closed");  const [origin, setOrigin] = React.useState<Origin | null>(null);  const [cardW, setCardW] = React.useState(CARD_W);  const [height, setHeight] = React.useState<number | null>(null);  const [verified, setVerified] = React.useState(false);  const [said, setSaid] = React.useState("");  const [run, setRun] = React.useState(0);  const wrapRef = React.useRef<HTMLSpanElement>(null);  const targetRef = React.useRef<HTMLElement | null>(null);  const cloneRef = React.useRef<HTMLElement | null>(null);  const holderRef = React.useRef<HTMLSpanElement>(null);  const contentRef = React.useRef<HTMLDivElement>(null);  const markRef = React.useRef<HTMLSpanElement>(null);  const ringRef = React.useRef<HTMLSpanElement>(null);  const pass = React.useRef(false);  const landedRef = React.useRef(false);  const timers = React.useRef<number[]>([]);  const descId = React.useId();  const titleId = React.useId();  // The server's word on freshness, whenever it changes.  const seed = freshUntil == null ? null : toMs(freshUntil);  React.useEffect(() => {    if (seed !== null) setTrust(scope, seed);  }, [seed, scope]);  // The gate only needs to know when the window opens and when it runs out; the badge keeps its own clock.  React.useEffect(() => {    const t = window.setTimeout(() => setNow(Date.now()), 0);    return () => window.clearTimeout(t);  }, [until]);  React.useEffect(() => {    if (now === null || until <= now) return;    const t = window.setTimeout(() => setNow(Date.now()), until - now + 5);    return () => window.clearTimeout(t);  }, [now, until]);  React.useEffect(() => {    const list = timers.current;    return () => {      list.forEach((t) => window.clearTimeout(t));      if (targetRef.current) targetRef.current.style.visibility = "";    };  }, []);  const fresh = now !== null && until > now;  const isOpen = phase === "open";  const showing = phase !== "closed";  // Growing: one frame at the button's size, then the card's.  React.useLayoutEffect(() => {    if (phase !== "opening") return;    let f2 = 0;    const f1 = requestAnimationFrame(() => {      f2 = requestAnimationFrame(() => setPhase("open"));    });    return () => {      cancelAnimationFrame(f1);      cancelAnimationFrame(f2);    };  }, [phase]);  // The button's own look sits at the top of the card while it grows, then gives way to the question.  React.useLayoutEffect(() => {    const holder = holderRef.current;    const clone = cloneRef.current;    if (!showing || !holder || !clone || holder.contains(clone)) return;    holder.replaceChildren(clone);  }, [showing]);  // The card's height follows its content (a view switch, an error line, the code boxes).  React.useLayoutEffect(() => {    const el = contentRef.current;    if (!showing || !el) return;    const measure = () => setHeight((h) => (h === el.offsetHeight ? h : el.offsetHeight));    measure();    const ro = new ResizeObserver(measure);    ro.observe(el);    return () => ro.disconnect();  }, [showing]);  /** Back down into the button, where it stands. */  const fold = React.useCallback(    (refocus: boolean) => {      const target = targetRef.current;      if (!target) return;      setPhase("closing");      timers.current.push(        window.setTimeout(          () => {            setPhase("closed");            setVerified(false);            setHeight(null);            target.style.visibility = "";            if (refocus) target.focus({ preventScroll: true });          },          reduced ? 0 : FOLD,        ),      );    },    [reduced],  );  // While open: Escape, a press elsewhere or focus leaving folds it back.  React.useEffect(() => {    if (phase !== "open") return;    const down = (e: PointerEvent) => {      if (!wrapRef.current?.contains(e.target as Node)) fold(false);    };    document.addEventListener("pointerdown", down);    return () => document.removeEventListener("pointerdown", down);  }, [phase, fold]);  const ask = (target: HTMLElement) => {    targetRef.current = target;    const o = originOf(target);    // As wide as the card wants, never wider than the screen; whatever sits around it makes room.    const room = window.innerWidth - 32;    const clone = target.cloneNode(true) as HTMLElement;    clone.removeAttribute("id");    clone.querySelectorAll("[id]").forEach((n) => n.removeAttribute("id"));    clone.setAttribute("aria-hidden", "true");    clone.setAttribute("inert", "");    Object.assign(clone.style, { margin: "0", pointerEvents: "none", visibility: "visible", width: `${o.width}px`, height: `${o.height}px`, flexShrink: "0" });    cloneRef.current = clone;    setOrigin(o);    setCardW(Math.max(o.width, Math.min(CARD_W, room)));    setVerified(false);    setSaid("");    setRun((r) => r + 1);    target.style.visibility = "hidden";    setPhase(reduced ? "open" : "opening");  };  const attempt = async (proof: SudoProof) => {    const result = await verify(proof);    const told = result instanceof Date || typeof result === "number" ? toMs(result) : null;    const nextUntil = told ?? Date.now() + trustFor * 1000;    setVerified(true);    const secs = Math.round((nextUntil - Date.now()) / 1000);    setSaid(`Verified. Unlocked for ${secs >= 90 ? `${Math.round(secs / 60)} minutes` : `${secs} seconds`}.`);    timers.current.push(      window.setTimeout(        () => {          const target = targetRef.current;          // The card folds, and the small padlock rides its corner back down, its ring filling.          fold(false);          setTrust(scope, nextUntil);          setNow(Date.now());          // With the button back, the click you made goes through to the app's own handler.          timers.current.push(            window.setTimeout(              () => {                if (!target) return;                target.focus({ preventScroll: true });                pass.current = true;                target.click();                pass.current = false;              },              reduced ? 20 : FOLD + 40,            ),          );        },        reduced ? 200 : 760,      ),    );  };  const onClickCapture = (e: React.MouseEvent<HTMLSpanElement>) => {    if (pass.current) return;    const t = e.target as HTMLElement;    const own = wrapRef.current?.firstElementChild;    if (!own?.contains(t)) return;    if (!showing && Date.now() < until) {      ringRef.current?.animate([{ transform: "none" }, { transform: "scale(1.12)" }, { transform: "none" }], { duration: 300, easing: EASE });      return;    }    e.preventDefault();    e.stopPropagation();    if (showing) return;    const target = (t.closest("button, a, [role='button'], input[type='submit']") as HTMLElement | null) ?? (own as HTMLElement);    if (own.contains(target) || own === target) ask(target);  };  const describedBy = [children.props["aria-describedby"], descId].filter(Boolean).join(" ");  const grow = (prop: string) => `${prop} ${isOpen ? GROW : FOLD}ms ${EASE}`;  const size = !showing || !origin ? undefined : isOpen || (reduced && phase !== "closing") ? { width: cardW, height: height ?? origin.height } : { width: origin.width, height: origin.height };  return (    <span      ref={wrapRef}      onClickCapture={onClickCapture}      className={`relative inline-flex align-top ${className}`}      // Never squeezed by a flex row it sits in: the card takes its full size and the row makes room.      style={size ? { ...size, flexShrink: 0, transition: reduced ? "none" : `${grow("width")}, ${grow("height")}` } : undefined}    >      {React.cloneElement(children, { "aria-describedby": describedBy })}      {showing && origin && (        <div          role="group"          aria-labelledby={titleId}          onKeyDown={(e) => {            if (e.key === "Escape") {              e.stopPropagation();              fold(true);            }          }}          onBlur={(e) => {            if (isOpen && !verified && document.hasFocus() && e.relatedTarget && !wrapRef.current?.contains(e.relatedTarget as Node)) fold(false);          }}          className="absolute inset-0 z-[1] overflow-clip text-popover-foreground"          style={{            borderRadius: isOpen ? RADIUS : origin.radius,            backgroundColor: isOpen ? "var(--popover)" : origin.bg,            boxShadow: "inset 0 0 0 1px var(--border)",            transition: reduced ? "none" : `${grow("border-radius")}, ${grow("background-color")}`,          }}        >          {/* The button itself, at the top of the card as it grows, and back again as it folds. */}          <span            ref={holderRef}            aria-hidden="true"            className="pointer-events-none absolute left-1/2 top-0 flex"            style={{              marginLeft: -origin.width / 2,              opacity: isOpen || reduced ? 0 : 1,              filter: isOpen && !reduced ? "blur(4px)" : "none",              transition: reduced ? "none" : isOpen ? `opacity 140ms ${EASE}, filter 140ms ${EASE}` : `opacity 200ms ${EASE} ${FOLD - 240}ms, filter 200ms ${EASE} ${FOLD - 240}ms`,            }}          />          <div            ref={contentRef}            className="absolute left-1/2 top-0"            style={{              width: cardW,              marginLeft: -cardW / 2,              opacity: isOpen ? 1 : 0,              filter: isOpen || reduced ? "none" : "blur(6px)",              transform: isOpen || reduced ? "none" : "translateY(-8px)",              transition: reduced ? "none" : isOpen ? `opacity 300ms ${EASE} 150ms, filter 420ms ${EASE} 150ms, transform 520ms ${EASE} 120ms` : `opacity 120ms ${EASE}, filter 120ms ${EASE}, transform 200ms ${EASE}`,            }}          >            <SudoGatePanel              key={run}              titleId={titleId}              methods={methods}              reason={reason}              codeHint={codeHint}              sendCode={sendCode}              attempt={attempt}              onCancel={() => fold(true)}              verified={verified}              reduced={reduced}              markRef={markRef}            />          </div>        </div>      )}      {badge && <Badge until={until} since={setAt.get(scope) ?? 0} trustFor={trustFor} reduced={reduced} hidden={phase === "open" || phase === "opening"} ringRef={ringRef} landedRef={landedRef} />}      <span id={descId} className="sr-only">        {fresh ? "Unlocked: you verified recently." : "Asks you to confirm it's you first."}      </span>      <span className="sr-only" role="status">        {said}      </span>    </span>  );}

Registry item: /r/sudo-gate.json