Home / Function/ UserAuthForm() — ui Function Reference

UserAuthForm() — ui Function Reference

Architecture documentation for the UserAuthForm() function in user-auth-form.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  003f00e2_a585_3604_889e_b59bec59070b["UserAuthForm()"]
  fa6cf377_9013_df19_53f0_66e8e9fbb7df["user-auth-form.tsx"]
  003f00e2_a585_3604_889e_b59bec59070b -->|defined in| fa6cf377_9013_df19_53f0_66e8e9fbb7df
  style 003f00e2_a585_3604_889e_b59bec59070b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

deprecated/www/app/(app)/examples/authentication/components/user-auth-form.tsx lines 13–71

export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
  const [isLoading, setIsLoading] = React.useState<boolean>(false)

  async function onSubmit(event: React.SyntheticEvent) {
    event.preventDefault()
    setIsLoading(true)

    setTimeout(() => {
      setIsLoading(false)
    }, 3000)
  }

  return (
    <div className={cn("grid gap-6", className)} {...props}>
      <form onSubmit={onSubmit}>
        <div className="grid gap-2">
          <div className="grid gap-1">
            <Label className="sr-only" htmlFor="email">
              Email
            </Label>
            <Input
              id="email"
              placeholder="name@example.com"
              type="email"
              autoCapitalize="none"
              autoComplete="email"
              autoCorrect="off"
              disabled={isLoading}
            />
          </div>
          <Button disabled={isLoading}>
            {isLoading && (
              <Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
            )}
            Sign In with Email
          </Button>
        </div>
      </form>
      <div className="relative">
        <div className="absolute inset-0 flex items-center">
          <span className="w-full border-t" />
        </div>
        <div className="relative flex justify-center text-xs uppercase">
          <span className="bg-background px-2 text-muted-foreground">
            Or continue with
          </span>
        </div>
      </div>
      <Button variant="outline" type="button" disabled={isLoading}>
        {isLoading ? (
          <Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
        ) : (
          <Icons.gitHub className="mr-2 h-4 w-4" />
        )}{" "}
        GitHub
      </Button>
    </div>
  )
}

Subdomains

Frequently Asked Questions

What does UserAuthForm() do?
UserAuthForm() is a function in the ui codebase, defined in deprecated/www/app/(app)/examples/authentication/components/user-auth-form.tsx.
Where is UserAuthForm() defined?
UserAuthForm() is defined in deprecated/www/app/(app)/examples/authentication/components/user-auth-form.tsx at line 13.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free