logo image
  • Overview

    • View all components
    • Install required things
  • Common UI

    • App Logo
    • Avatar
    • Button
    • Badge
    • Typography

    • Forms

    • Notification
    • Modal
    • Card
    • Breadcrumb
    • Pagination
    • Top Progress Bar
    • Table
    • Item Grid
    • Youtube Video
  • Features UI

    • Live chat button
  • Sections

    • Hero Banner
    • FAQs
  • Layouts

    • common

    • TopBar Layout
    • SideBar Layout
  1. Home
  2. Components
  3. Common Ui
  4. Forms
  5. Common
  6. Auth Form Providers

Auth Form Providers Component

The AuthFormProvider component renders third-party sign-in buttons like Google and GitHub. It provides a clean, consistent UI using Tailwind CSS and can be easily reused across your sign-in or sign-up pages. This makes integrating OAuth providers simple and stylish.


Auth Form Providers preview

Or continue with

Please install everything that's required

Before setup and using this component, please install all the required dependencies from this link (if you have never installed).

1. Setup codes

Create a new file components/ui/icons/GoogleIcon.tsx

jsx
import React from "react"; import { cn } from "@/utils/cn"; import GoogleIcon from "../icons/GoogleIcon"; const AuthFormProviders = ({ className }: { className?: string }) => { return ( <div className={cn(className)}> <div className="relative"> <div aria-hidden="true" className="absolute inset-0 flex items-center"> <div className="w-full border-t border-gray-200" /> </div> <div className="relative flex justify-center text-sm/6 font-medium"> <span className="bg-white px-6 text-gray-900">Or continue with</span> </div> </div> <div className="mt-3 grid grid-cols-1 gap-4"> <a href="#" className="flex w-full items-center justify-center gap-3 rounded-full bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus-visible:ring-transparent" > <GoogleIcon /> <span className="text-sm/6 font-semibold">Google</span> </a> </div> </div> ); }; export default AuthFormProviders;

Create a new file components/ui/Forms/common/AuthFormProvider.tsx and add this code below

jsx
import React from "react"; import GoogleIcon from "@/components/icons/GoogleIcon"; import { cn } from "@/utils/cn"; const AuthFormProviders = ({ className }: { className?: string }) => { return ( <div className={cn(className)}> <div className="relative"> <div aria-hidden="true" className="absolute inset-0 flex items-center"> <div className="w-full border-t border-gray-200" /> </div> <div className="relative flex justify-center text-sm/6 font-medium"> <span className="bg-white px-6 text-gray-900">Or continue with</span> </div> </div> <div className="mt-3 grid grid-cols-1 gap-4"> <a href="#" className="flex w-full items-center justify-center gap-3 rounded-full bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus-visible:ring-transparent" > <GoogleIcon /> <span className="text-sm/6 font-semibold">Google</span> </a> </div> </div> ); }; export default AuthFormProviders;

2. Usages

We can use this component in both Signin Form and Signup Form for providers authentication

jsx
<Form action="#" className="grid grid-cols-1 gap-y-4"> ... <AuthFormProviders /> </Form>

The UI will be shown like that

Or continue with

Learn more to using AuthFormProvider component in Signin, Signup forms on this link

On this page

  1. 1. Setup codes

  2. 2. Usages