Home / File/ user-auth-form.tsx — ui Source File

user-auth-form.tsx — ui Source File

Architecture documentation for user-auth-form.tsx, a tsx file in the ui codebase. 6 imports, 0 dependents.

File tsx ComponentRegistry UIPrimitives 6 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  fa6cf377_9013_df19_53f0_66e8e9fbb7df["user-auth-form.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  fa6cf377_9013_df19_53f0_66e8e9fbb7df --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  fa6cf377_9013_df19_53f0_66e8e9fbb7df --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  aae3c3f1_230a_9c11_a663_8bbc3f0ad054["icons"]
  fa6cf377_9013_df19_53f0_66e8e9fbb7df --> aae3c3f1_230a_9c11_a663_8bbc3f0ad054
  aa2f3ec6_f291_3763_88ec_65a3f5ad5939["button"]
  fa6cf377_9013_df19_53f0_66e8e9fbb7df --> aa2f3ec6_f291_3763_88ec_65a3f5ad5939
  2de1d0e1_ab37_e1b0_4ef3_da8c8fa66107["input"]
  fa6cf377_9013_df19_53f0_66e8e9fbb7df --> 2de1d0e1_ab37_e1b0_4ef3_da8c8fa66107
  fa665cdb_5f79_b81a_95ab_12ba182fc175["label"]
  fa6cf377_9013_df19_53f0_66e8e9fbb7df --> fa665cdb_5f79_b81a_95ab_12ba182fc175
  style fa6cf377_9013_df19_53f0_66e8e9fbb7df fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"

import { cn } from "@/lib/utils"
import { Icons } from "@/components/icons"
import { Button } from "@/registry/new-york/ui/button"
import { Input } from "@/registry/new-york/ui/input"
import { Label } from "@/registry/new-york/ui/label"

interface UserAuthFormProps extends React.HTMLAttributes<HTMLDivElement> {}

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

Functions

Dependencies

  • button
  • icons
  • input
  • label
  • react
  • utils

Frequently Asked Questions

What does user-auth-form.tsx do?
user-auth-form.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in user-auth-form.tsx?
user-auth-form.tsx defines 1 function(s): UserAuthForm.
What does user-auth-form.tsx depend on?
user-auth-form.tsx imports 6 module(s): button, icons, input, label, react, utils.
Where is user-auth-form.tsx in the architecture?
user-auth-form.tsx is located at deprecated/www/app/(app)/examples/authentication/components/user-auth-form.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: deprecated/www/app/(app)/examples/authentication/components).

Analyze Your Own Codebase

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

Try Supermodel Free