# Login 2

> Login 2 variant for block.

A shadcn/ui block from the [@uiable](https://uiable.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/uiable/block-login-2).

- Page, with a live preview: https://shadcn.exchange/r/uiable/block-login-2
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/uiable/block-login-2-light-ca5bf361df8dc95a.png
- Registry item: https://uiable.com/r/block-login-2.json
- Categories: login
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://uiable.com/r/block-login-2.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@uiable/button`, `@uiable/checkbox`, `@uiable/field`, `@uiable/input`, `@uiable/logo`, `@uiable/separator`

## Files

### `src/components/uiable/blocks/login/login-2/login-2.tsx`

```tsx
// shadcn
import { Button } from "@/components/ui/button"
import { Checkbox } from "@/components/ui/checkbox"
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { Separator } from "@/components/ui/separator"

// project-imports
import Logo from "@/components/uiable/layout/shared/logo"

interface SocialProvider {
  name: string
  src: string
}

const SOCIAL_PROVIDERS: SocialProvider[] = [
  {
    name: "Facebook",
    src: "https://cdn.uiable.com/authentication/facebook.svg",
  },
  {
    name: "Twitter",
    src: "https://cdn.uiable.com/authentication/twitter.svg",
  },
  {
    name: "Google",
    src: "https://cdn.uiable.com/authentication/google.svg",
  },
]

//  ------------------------------ | LOGIN 2 | ------------------------------  //

export default function Login2() {
  return (
    <div className="flex min-h-screen w-full items-center justify-center bg-[url('https://cdn.uiable.com/authentication/img-auth-bg.jpg')] bg-cover bg-center px-4 py-10 dark:bg-[url('https://cdn.uiable.com/authentication/img-auth-bg-dark.jpg')]">
      <div className="w-full max-w-120 rounded-lg border border-border bg-card p-6 shadow-sm sm:p-8 md:p-10">
        <div className="flex flex-col gap-6">
          <Logo className="justify-center" link={false} />

          <div className="grid gap-2">
            {SOCIAL_PROVIDERS.map((provider) => (
              <Button
                key={provider.name}
                variant="outline"
                type="button"
                className="justify-center gap-2 text-slate-500 hover:border-blue-500 dark:border-border dark:text-slate-400 dark:hover:border-blue-400"
              >
                <img
                  src={provider.src}
                  alt={provider.name}
                  className="size-4"
                />
                Sign In with {provider.name}
              </Button>
            ))}
          </div>

          <div className="relative flex items-center">
            <Separator className="flex-1" />
            <span className="bg-card px-5 text-muted-foreground">OR</span>
            <Separator className="flex-1" />
          </div>

          <div className="flex items-baseline justify-between">
            <h2 className="text-2xl font-semibold">Login</h2>
            <a href="#" className="text-primary hover:underline">
              Don&apos;t have an account?
            </a>
          </div>

          <FieldGroup>
            <Field>
              <FieldLabel htmlFor="email-login">Email Address</FieldLabel>
              <Input
                id="email-login"
                type="email"
                required
                placeholder="Enter email address"
              />
            </Field>

            <Field>
              <FieldLabel htmlFor="password-login">Password</FieldLabel>
              <Input
                id="password-login"
                type="password"
                required
                placeholder="Enter password"
              />
            </Field>

            <div className="-mt-1 flex items-center justify-between">
              <label
                htmlFor="keepSignedIn"
                className="flex cursor-pointer items-center gap-2"
              >
                <Checkbox id="keepSignedIn" defaultChecked />
                <span className="text-sm font-medium">Keep me sign in</span>
              </label>
              <a
                href="#"
                className="text-sm font-medium text-foreground hover:text-primary"
              >
                Forgot Password?
              </a>
            </div>

            <Button
              type="submit"
              size="lg"
              className="w-full hover:scale-[1.02]"
            >
              Login
            </Button>
          </FieldGroup>
        </div>
      </div>
    </div>
  )
}
```
