DDBS UI
modals

Auth Dialog

A sign-in and sign-up dialog with tabs, validation, a server error slot, a social buttons slot and a welcome screen. For the store version see Store Auth Modal.

npx shadcn@latest add https://ui.develop-better-solutions.com/r/auth-dialog.json
Dependencies:lucide-react
Fullscreen

Usage

auth-dialog-example.tsx
"use client";

import { useState } from "react";
import { AuthDialog } from "@dbs/ui";

export default function AuthDialogExample() {
  const [open, setOpen] = useState(false);
  return (
    <>
      <button type="button" onClick={() => setOpen(true)} className="h-11 rounded-full bg-ink px-6 text-sm font-medium text-canvas">Sign in</button>
      <AuthDialog
        open={open}
        onOpenChange={setOpen}
        eyebrow="Patient portal"
        socialSlot={<button type="button" className="h-11 rounded-full border border-line text-sm font-medium hover:bg-surface">Continue with single sign-on</button>}
        onSubmit={(mode, c) => (c.email.startsWith("taken") && mode === "signup" ? "That email already has an account." : undefined)}
      />
    </>
  );
}