GitHub

SignupForm

A complete signup form block with name, email, password fields, social signup, and sign in link.

Loading...
CMSCMS Ready

The SignupForm component accepts customizable title, description, and link props for CMS integration. Content editors can configure form text without code changes.

Basic Usage

import { SignupForm } from "@corew500/ui"

<SignupForm
  onFormSubmit={(data) => console.log(data)}
  onSocialSignup={(provider) => console.log(provider)}
/>

With Glow Effect

Enable interactive glow effects on all inputs and buttons.

<SignupForm
  glow
  onFormSubmit={(data) => handleSignup(data)}
/>

The glow effect adds:

  • Mouse-tracking radial gradient on input fields
  • Animated gradient underline on buttons that fades in on hover

Custom Content

<SignupForm
  title="Join our platform"
  description="Create your account to get started"
  signInHref="/login"
/>

Loading State

<SignupForm loading />

With Authentication (feature-auth)

Different Package

The examples below use @corew500/feature-auth, which wraps this UI component with Supabase authentication. Install it separately for full auth functionality.

For complete Supabase authentication, use the wrapper from @corew500/feature-auth:

import { SignupForm } from "@corew500/feature-auth"

// Basic usage
<SignupForm
  signInHref="/login"
  termsHref="/terms"
  privacyHref="/privacy"
/>

Lifecycle Callbacks

Hook into the authentication flow for analytics, error handling, or custom behavior:

import { SignupForm } from "@corew500/feature-auth"

<SignupForm
  onSuccess={({ email, name }) => {
    analytics.track('signup_success', { email, name })
    showWelcomeToast(name)
  }}
  onAuthError={(error) => {
    if (error.code === 'user_already_exists') {
      showToast('An account with this email already exists')
    }
    analytics.track('signup_failed', { code: error.code })
  }}
  onSubmitStart={() => {
    setGlobalLoading(true)
  }}
/>

With User Metadata

Pass additional metadata to store with the user:

import { SignupForm } from "@corew500/feature-auth"

<SignupForm
  metadata={{
    referral_code: referralCode,
    signup_source: 'landing_page',
  }}
  onSuccess={({ email }) => {
    analytics.identify(email)
  }}
/>

Client-Side Validation

Enable real-time validation with password strength requirements:

import { SignupForm } from "@corew500/feature-auth"

<SignupForm
  validation={{
    enableClientValidation: true,
    validationMode: 'onBlur',
    signupOptions: {
      requirePasswordStrength: true,
    },
  }}
  features={{
    passwordRequirements: true,
  }}
/>

Props

PropTypeDefaultDescription
onFormSubmit(data: SignupFormData) => voidCalled when the form is submitted
onSocialSignup(provider: string) => voidCalled when social signup button is clicked
signInHrefstring#URL for sign in link
loadingenumfalseWhether the form is in a loading state
titlestringCreate an accountCustom title for the card
descriptionstringEnter your information below to create your accountCustom description for the card
glowenumfalseEnable glow effects on inputs and buttons
successenumfalseWhen true, shows success state instead of form
successTitlestringAccount Created!Title shown in success state
successDescriptionstringPlease check your email to verify your account.Description shown in success state
successSubDescriptionstringSecondary description shown in success state
successActionenumOptional action element for success state
labels{ name?: string; email?: string; password?: string; confirmPassword?: string; terms?: string; termsLink?: string; termsConjunction?: string; privacyLink?: string; }{}
placeholders{ name?: string; email?: string; password?: string; confirmPassword?: string; }{}
descriptions{ email?: string; password?: string; confirmPassword?: string; }{}
buttonLabels{ submit?: string; loading?: string; signIn?: string; signInPrompt?: string; socialGoogle?: string; }{}
errors{ name?: string; email?: string; password?: string; confirmPassword?: string; terms?: string; general?: string; }{}
features{ passwordToggle?: boolean; passwordRequirements?: boolean; termsCheckbox?: boolean; socialLogin?: boolean; socialSignup?: boolean; }{}
termsHrefstring#URL for terms of service
privacyHrefstring#URL for privacy policy
passwordRequirementsPasswordRequirement[]Custom password requirements