Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Pro (paid add-on)

Account forms

Pro

Five ready-made form templates that cover the whole sign-in flow: sign in, sign up, forgot password, reset password and verify a code. They handle the interface, validation and accessibility; you connect your own backend.

Part of Pro

The account forms are in @vjdesigns-pro/ui, the commercial add-on package. See pricing. They use the same tokens, themes, 32 languages, right-to-left support and WCAG 2.2 AA standard as the free package.

The five forms

The five forms
FormFieldsSends to onSubmit
SignInFormEmail (or username), password, "Remember me", "Forgot password?", and optional social sign-in buttons{ identifier, password, remember }
SignUpFormName, email, a new password with a live checklist and strength meter, an optional confirmation and an optional terms checkbox{ name, email, password, acceptTerms }
ForgotPasswordFormEmail; then a confirmation with "Send again"{ email }
ResetPasswordFormA new password (same checklist and strength meter), with an optional confirmation{ password }
VerifyCodeFormA 6-digit code (from email, SMS or an authenticator app), with "Resend code"{ code }

Install

Pro needs a license, and installs from its own private registry; the free package still installs from npmjs.com. After purchase, store your base64-encoded license key in an environment variable such as VJDESIGNS_PRO_KEY (never commit it), and add these lines to your project's .npmrc. Pro needs @vjdesigns/vjdesigns-ui 3.8.0 or later, and React 19.

.npmrcini
@vjdesigns-pro:registry=https://npm.pkg.keygen.sh/d1d3d49f-4fac-4bee-a1d9-2a65097f3737/
//npm.pkg.keygen.sh/:username=license
//npm.pkg.keygen.sh/:_password=${VJDESIGNS_PRO_KEY}

To base64-encode your license key:

bash
# PowerShell
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("<your license key>"))

# macOS or Linux
printf %s "<your license key>" | base64

Then install both packages:

bash
npm install @vjdesigns/vjdesigns-ui @vjdesigns-pro/ui

Import both stylesheets once, at your app's entry point:

ts
import "@vjdesigns/vjdesigns-ui/dist/vjdesigns-ui.css";
import "@vjdesigns-pro/ui/dist/vjdesigns-ui-pro.css";

Connect your backend

The forms handle the interface; you connect your own backend (Auth.js, Supabase, Firebase, Cognito or your own API) through onSubmit. It receives clean values (emails trimmed) and returns:

  • Nothing when it worked. onSuccess(values) then runs, for example to redirect.
  • { error } for a problem with the whole form ("Email or password is incorrect.", "This link has expired."). It's shown above the form and takes focus.
  • { fieldErrors: { email: "…" } } for a problem with one field ("An account with this email already exists."). It's shown on that field until it's edited.

If onSubmit throws (a network failure, say), the form shows "Something went wrong. Try again." instead of breaking.

tsx
import { SignInForm } from "@vjdesigns-pro/ui";

<SignInForm
  logo={<YourLogo />}
  forgotPasswordHref="/forgot-password"
  signUpHref="/sign-up"
  providers={<GoogleButton />}
  onSubmit={async ({ identifier, password, remember }) => {
    const res = await fetch("/api/sign-in", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ email: identifier, password, remember }),
    });
    if (res.status === 401) return { error: "Email or password is incorrect." };
    if (res.status === 429) return { error: "Too many attempts. Try again in 5 minutes." };
    if (!res.ok) throw new Error(`Sign-in failed: ${res.status}`);
  }}
  onSuccess={() => router.push("/dashboard")}
/>

VerifyCodeForm submits as soon as the last digit is typed or pasted. Pass onResend to show "Resend code", which waits out resendCooldown (30 seconds by default) between sends.

tsx
import { VerifyCodeForm } from "@vjdesigns-pro/ui";

<VerifyCodeForm
  destination="j•••@example.com"
  onResend={() => api.sendCode()}
  onSubmit={async ({ code }) => {
    const ok = await api.verify(code);
    if (!ok) return { fieldErrors: { code: "That code isn't right. Check it and try again." } };
  }}
  onSuccess={() => router.push("/dashboard")}
/>

What's built in

  • Password managers and autofill: a real <form>, with autocomplete set correctly on every field (username, current-password, new-password, one-time-code). Phones offer emailed and texted codes, and pasting a code fills every box.
  • Passkeys: passkeys on SignInForm lets the browser offer saved passkeys in the email field. Your page still starts the passkey request; this only allows it.
  • Validation: missing fields, malformed emails, short passwords, mismatched confirmations, unchecked terms and partial codes are caught before anything is sent. They're shown on each field and in a summary that takes focus.
  • Password rules follow current NIST guidance: a minimum length (12 by default, passwordMinLength) and no forced symbol mix. Pass passwordRequirements for your own rules; the live checklist and the validation both use them.
  • Safe messages: return one message for any failed sign-in, and the ForgotPasswordForm confirmation never says whether an account exists. That way the forms don't reveal which emails are registered.
  • Resend cooldown: "Resend code" shows the remaining wait ("Resend code in 0:24") and stays focusable while it waits, so the countdown can be read.
  • Look and layout: variant="card" (the default) or "plain" to sit in your own layout, plus logo, title, description, headingLevel and footer. Every form works in both modes, all brands, all 32 languages and right to left.

Warning: Checks in the browser aren't security

Anyone can bypass the browser, so your backend must validate everything again, rate-limit sign-in attempts, and never trust what the form sends.

Build your own

Everything the account forms are built from is free: Field, PasswordInput, PinInput, ErrorSummary and useFormValidation. Server errors you set on a field stay until that field is edited or the form is submitted again.