Components Registration Form

Registration Form

User registration form component with validation states, password strength indicators, and accessibility features.

Preview Mode WCAG AA Mobile Ready

Basic Registration Form

Standard registration form with username, email, password, and password confirmation fields.

3-20 characters, letters, numbers, and underscores only

<form class="space-y-6">
    <div>
        <label for="fullname" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
            Full Name
        </label>
        <input type="text"
               id="fullname"
               name="fullname"
               class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white"
               placeholder="Enter your full name">
    </div>

    <div>
        <label for="username" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
            Username
        </label>
        <input type="text"
               id="username"
               name="username"
               class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white"
               placeholder="Choose a username">
        <p class="mt-1 text-sm text-gray-500 dark:text-gray-400">
            3-20 characters, letters, numbers, and underscores only
        </p>
    </div>

    <div>
        <label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
            Email Address
        </label>
        <input type="email"
               id="email"
               name="email"
               class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white"
               placeholder="Enter your email address">
    </div>

    <div>
        <label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
            Password
        </label>
        <input type="password"
               id="password"
               name="password"
               class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white"
               placeholder="Create a strong password">
    </div>

    <div>
        <label for="password-confirm" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
            Confirm Password
        </label>
        <input type="password"
               id="password-confirm"
               name="password_confirm"
               class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white"
               placeholder="Confirm your password">
    </div>

    <div class="flex items-start">
        <div class="flex items-center h-5">
            <input id="terms"
                   name="terms"
                   type="checkbox"
                   class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
        </div>
        <div class="ml-3 text-sm">
            <label for="terms" class="text-gray-700 dark:text-gray-300">
                I agree to the
                <a href="#" class="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300">Terms of Service</a>
                and
                <a href="#" class="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300">Privacy Policy</a>
            </label>
        </div>
    </div>

    <div>
        <button type="submit"
                class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:focus:ring-offset-gray-800">
            Create Account
        </button>
    </div>
</form>

Password Strength Indicator

Registration form with real-time password strength feedback and validation.

Password strength Strong
At least 8 characters
Contains uppercase letter
Contains number
Contains special character

Validation States

Registration form showing different validation states including errors, success, and loading.

Error State

Username must be at least 3 characters

This email is already registered

Passwords do not match

Success State

Username is available

Valid email format

Account Created Successfully

Please check your email to verify your account.

Accessibility Features

✓ WCAG 2.1 AA Compliant

  • • Proper semantic HTML with form labels
  • • ARIA attributes for validation states
  • • High contrast colors for text and borders
  • • Keyboard navigation support
  • • Screen reader compatible error messages
  • • Focus indicators for all interactive elements
  • • Password strength feedback for screen readers

Usage Guidelines

When to use

  • • New user account creation
  • • Member registration pages
  • • Sign-up workflows
  • • User onboarding processes

Best practices

  • • Include password strength indicators
  • • Validate input in real-time when possible
  • • Provide clear error messages
  • • Include links to Terms of Service and Privacy Policy
  • • Use appropriate input types (email, password)
  • • Test with screen readers and keyboard navigation
  • • Consider password confirmation fields for critical applications