Skip to content
GetUrUI

Sign Up Form

.md

Sign-up card with a GitHub button, an email field that validates and shakes, an animated password-strength meter, a stateful submit and a success state that morphs in with a drawn check.

sign upauthformvalidationpassword strengthregister

Installation

$npx shadcn@latest add @geturui/sign-up-form
Download source (.zip)

Also installs: Button, Input

Usage

usage.tsx
1import { SignUpForm } from "@/components/blocks/sign-up-form";
2
3export default function SignUp() {
4  return (
5    <SignUpForm
6      signInHref="/sign-in"
7      onGithub={() => (window.location.href = "/api/auth/github")}
8      onSubmit={async ({ email, password }) => {
9        const res = await fetch("/api/sign-up", { method: "POST", body: JSON.stringify({ email, password }) });
10        if (!res.ok) throw new Error("Sign up failed");
11      }}
12    />
13  );
14}

Props

PropTypeDefaultDescription
onSubmit(values: { email; password }) => Promise<void> | void—Called with valid values. Throw or reject to stay on the form and shake the button.
onGithub() => void—GitHub button handler.
showGithubbooleantrueShow the GitHub button and divider.
minPasswordLengthnumber8Minimum length; also the first step of the strength meter.
title / descriptionstring—Card heading copy.
submitLabelstring"Create account"Submit button label.
termsHref / privacyHref / signInHrefstring—Links in the footer line.
successTitlestring"Check your inbox"Heading of the success state.

Accessibility

  • Fields have visible labels; errors are linked with aria-describedby and set aria-invalid.
  • The show-password control is a labelled toggle button with aria-pressed; the strength label is announced politely.
  • Enter submits from either field; the success state is a status region and "Use a different email" returns focus to the email field.

Related