# Login Button Email 1 - Log in

> Email login CTA — default variant.

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

- Page, with a live preview: https://shadcn.exchange/r/shadcnblocks/login-button-login-button-email-1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnblocks/login-button-login-button-email-1-light-61c4963679e42431.png
- Registry item: https://shadcnblocks.com/r/login-button-login-button-email-1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://shadcnblocks.com/r/login-button-login-button-email-1.json
```

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

## Dependencies

- npm packages: `cn`, `lucide-react`, `radix-ui`
- Registry items: `button`

## Files

### `example/login-button/login-button-email-1.tsx`

```tsx
import { LoginButton } from "@/components/shadcnblocks/login-button";

export const title = "Log in";

const Example = () => <LoginButton variant="default">Log in</LoginButton>;

export default Example;
```

### `components/shadcnblocks/login-button.tsx`

```tsx
import { Slot } from "radix-ui";
import { LogIn } from "lucide-react";
import { cn } from "cn";

import { buttonVariants } from "@/components/ui/button";
type LoginButtonVariant =
  | "default"
  | "secondary"
  | "outline"
  | "ghost"
  | "link";

export interface LoginButtonProps
  extends React.ButtonHTMLAttributes<HTMLButtonElement> {
  variant?: LoginButtonVariant;
  showIcon?: boolean;
  asChild?: boolean;
}

export const LoginButton = ({
  variant = "default",
  showIcon = true,
  asChild = false,
  children = "Log in",
  className,
  ...props
}: LoginButtonProps) => {
  const Comp = asChild ? Slot.Root : "button";

  return (
    <Comp
      type={asChild ? undefined : "button"}
      className={cn(buttonVariants({ variant, size: "default" }), "gap-2", className)}
      {...props}
    >
      {showIcon && <LogIn className="size-4" />}
      {children}
    </Comp>
  );
};
```
