Use it as your Auth0 login screen
src/screens/login/index.tsx
import { login, useErrors, useScreen, useTransaction } from "@auth0/auth0-acul-react/login";
import PullCordLogin from "@/components/PullCordLogin";
export default function LoginScreen() {
const screen = useScreen();
const transaction = useTransaction();
const { errors } = useErrors();
// Wrong password, blocked user, failed captcha: Auth0 reloads this screen and the message lands here.
const serverError = errors.byType("auth0")[0]?.message;
return (
<main className="grid min-h-dvh place-items-center overflow-hidden bg-[#07080c]">
{serverError && (
<p role="alert" className="fixed left-1/2 top-6 z-10 -translate-x-1/2 rounded-full bg-red-500/15 px-4 py-2 text-sm text-red-200">
{serverError}
</p>
)}
<PullCordLogin
defaultOn
subtitle="Sign in to continue"
forgotHref={screen.resetPasswordLink ?? "#"}
forgotLabel={transaction.isForgotPasswordEnabled ? "Forgot password?" : ""}
footerText={transaction.isSignupEnabled ? "No account?" : ""}
footerAction={transaction.isSignupEnabled ? "Create one" : ""}
onFooterAction={
transaction.isSignupEnabled && screen.signupLink
? () => window.location.assign(screen.signupLink!)
: undefined
}
onSubmit={async (email, password) => {
// login() posts a form to Auth0 and the browser leaves the page.
// It does not reject on a wrong password, so keep the spinner going
// until the page unloads instead of showing a success label.
await login({ username: email, password });
await new Promise<never>(() => {});
}}
/>
</main>
);
}
src/index.css (add at the end)
/* src/index.css in the ACUL sample: keep its existing lines, add this at the end. */
/* Pull-Cord's inputs carry font-sans. Tailwind v4 doesn't read the piece's
tailwind.config.js, so pin the room's font here, scoped to the room. */
.qpc-room .font-sans {
font-family: "Space Grotesk", system-ui, sans-serif;
}