Tailwind CSS Login Page Examples
A growing collection of login page examples for Tailwind CSS. Copy and paste the HTML into your project and adjust it with utility classes.
<div class="flex min-h-svh flex-col items-center justify-center p-6 md:p-10">
<div class="flex w-full max-w-sm flex-col gap-6">
<a
href="#"
class="self-center text-foreground [&>svg]:size-7"
aria-label="Starting Point"
><svg
xmlns="http://www.w3.org/2000/svg"
viewBox="4 4 16 16"
fill="currentColor"
>
<path
d="M6.5 16.5 16.5 6.5"
fill="none"
stroke="currentColor"
stroke-width="4"
stroke-linecap="round"
></path>
<circle cx="17" cy="17" r="2.5"></circle></svg
></a>
<div class="grid justify-items-center gap-2 text-center">
<h1 class="text-xl font-medium tracking-tight">Log in to your account</h1>
<p class="text-sm text-balance text-muted-foreground">
Enter your email and password below to log in
</p>
</div>
<button type="button" class="btn btn-outline">
<svg
class="icon-start"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
>
<path
fill="#4285F4"
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.27-4.74 3.27-8.1z"
></path>
<path
fill="#34A853"
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z"
></path>
<path
fill="#FBBC05"
d="M5.84 14.1A6.6 6.6 0 0 1 5.5 12c0-.73.13-1.44.34-2.1V7.07H2.18A11 11 0 0 0 1 12c0 1.78.43 3.45 1.18 4.93l3.66-2.84z"
></path>
<path
fill="#EA4335"
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1A11 11 0 0 0 2.18 7.07l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"
></path></svg
>Log in with Google
</button>
<div class="field-separator my-0">
<span class="text-xs uppercase">Or continue with email</span>
</div>
<form
id="simple-login-page"
class="field-group"
action="/login"
method="post"
>
<div class="field">
<label class="label" for="simple-login-page-email">Email address</label
><input
class="input"
id="simple-login-page-email"
type="email"
placeholder="[email protected]"
autocomplete="email"
required=""
autofocus=""
name="email"
/>
</div>
<div class="field">
<div class="flex items-center">
<label class="label" for="simple-login-page-password">Password</label
><a
href="#"
class="ms-auto text-sm underline-offset-4 hover:underline"
>Forgot your password?</a
>
</div>
<div class="input-group">
<input
class="input"
id="simple-login-page-password"
type="password"
placeholder="Password"
autocomplete="current-password"
required=""
name="password"
/>
<div class="input-group-addon input-group-addon-end">
<button
type="button"
class="btn btn-ghost btn-xs btn-icon"
aria-label="Show password"
aria-pressed="false"
data-password-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="in-aria-pressed:hidden"
>
<path
d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"
></path>
<circle cx="12" cy="12" r="3"></circle></svg
><svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="hidden in-aria-pressed:block"
>
<path
d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"
></path>
<path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"></path>
<path
d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"
></path>
<path d="m2 2 20 20"></path>
</svg>
</button>
</div>
</div>
</div>
<div class="field field-horizontal">
<input
type="checkbox"
class="checkbox"
id="simple-login-page-remember"
name="remember"
/>
<div class="field-content">
<label class="label" for="simple-login-page-remember"
>Remember me</label
>
</div>
</div>
<button type="submit" class="btn">Log in</button>
<script>
{
const form = document.currentScript.closest("form");
for (const button of form.querySelectorAll(
"[data-password-toggle]",
)) {
button.addEventListener("click", () => {
const input = button
.closest(".input-group")
.querySelector("input");
const show = input.type === "password";
input.type = show ? "text" : "password";
button.setAttribute("aria-pressed", show);
});
}
}
</script>
</form>
<p
class="text-center text-sm text-muted-foreground [&_a]:font-medium [&_a]:text-foreground [&_a]:underline-offset-4 [&_a:hover]:underline"
>
Don't have an account? <a href="#">Sign up</a>
</p>
</div>
</div><div
class="flex min-h-svh flex-col items-center justify-center bg-muted p-6 md:p-10"
>
<div class="flex w-full max-w-md flex-col gap-6">
<a
href="#"
class="self-center text-foreground [&>svg]:size-7"
aria-label="Starting Point"
><svg
xmlns="http://www.w3.org/2000/svg"
viewBox="4 4 16 16"
fill="currentColor"
>
<path
d="M6.5 16.5 16.5 6.5"
fill="none"
stroke="currentColor"
stroke-width="4"
stroke-linecap="round"
></path>
<circle cx="17" cy="17" r="2.5"></circle></svg
></a>
<div class="card gap-0 py-0">
<div class="card-content grid gap-6 px-6 py-8 sm:px-10">
<div class="grid justify-items-center gap-2 text-center">
<h1 class="text-xl font-medium tracking-tight">
Log in to your account
</h1>
<p class="text-sm text-balance text-muted-foreground">
Enter your email and password below to log in
</p>
</div>
<button type="button" class="btn btn-outline">
<svg
class="icon-start"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
>
<path
fill="#4285F4"
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.27-4.74 3.27-8.1z"
></path>
<path
fill="#34A853"
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z"
></path>
<path
fill="#FBBC05"
d="M5.84 14.1A6.6 6.6 0 0 1 5.5 12c0-.73.13-1.44.34-2.1V7.07H2.18A11 11 0 0 0 1 12c0 1.78.43 3.45 1.18 4.93l3.66-2.84z"
></path>
<path
fill="#EA4335"
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1A11 11 0 0 0 2.18 7.07l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"
></path></svg
>Log in with Google
</button>
<div class="field-separator my-0">
<span class="text-xs uppercase">Or continue with email</span>
</div>
<form
id="card-login-page"
class="field-group"
action="/login"
method="post"
>
<div class="field">
<label class="label" for="card-login-page-email"
>Email address</label
><input
class="input"
id="card-login-page-email"
type="email"
placeholder="[email protected]"
autocomplete="email"
required=""
autofocus=""
name="email"
/>
</div>
<div class="field">
<div class="flex items-center">
<label class="label" for="card-login-page-password"
>Password</label
><a
href="#"
class="ms-auto text-sm underline-offset-4 hover:underline"
>Forgot your password?</a
>
</div>
<div class="input-group">
<input
class="input"
id="card-login-page-password"
type="password"
placeholder="Password"
autocomplete="current-password"
required=""
name="password"
/>
<div class="input-group-addon input-group-addon-end">
<button
type="button"
class="btn btn-ghost btn-xs btn-icon"
aria-label="Show password"
aria-pressed="false"
data-password-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="in-aria-pressed:hidden"
>
<path
d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"
></path>
<circle cx="12" cy="12" r="3"></circle></svg
><svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="hidden in-aria-pressed:block"
>
<path
d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"
></path>
<path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"></path>
<path
d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"
></path>
<path d="m2 2 20 20"></path>
</svg>
</button>
</div>
</div>
</div>
<div class="field field-horizontal">
<input
type="checkbox"
class="checkbox"
id="card-login-page-remember"
name="remember"
/>
<div class="field-content">
<label class="label" for="card-login-page-remember"
>Remember me</label
>
</div>
</div>
<button type="submit" class="btn">Log in</button>
<script>
{
const form = document.currentScript.closest("form");
for (const button of form.querySelectorAll(
"[data-password-toggle]",
)) {
button.addEventListener("click", () => {
const input = button
.closest(".input-group")
.querySelector("input");
const show = input.type === "password";
input.type = show ? "text" : "password";
button.setAttribute("aria-pressed", show);
});
}
}
</script>
</form>
<p
class="text-center text-sm text-muted-foreground [&_a]:font-medium [&_a]:text-foreground [&_a]:underline-offset-4 [&_a:hover]:underline"
>
Don't have an account? <a href="#">Sign up</a>
</p>
</div>
</div>
</div>
</div><div class="grid min-h-svh lg:grid-cols-2">
<div
class="relative hidden flex-col bg-neutral-900 p-10 text-white lg:flex dark:border-e"
>
<img
src="https://images.unsplash.com/photo-1513569771920-c9e1d31714af?w=1400&q=80&auto=format&fit=crop"
alt=""
class="absolute inset-0 size-full object-cover"
/>
<div
class="absolute inset-0 bg-linear-to-b from-black/30 via-transparent to-black/60"
></div>
<a href="#" class="brand relative text-lg text-white"
><span class="brand-logo brand-logo-lg bg-white text-neutral-900"
><svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M6.5 16.5 16.5 6.5"
fill="none"
stroke="currentColor"
stroke-width="4"
stroke-linecap="round"
></path>
<circle cx="17" cy="17" r="2.5"></circle></svg></span
><span class="brand-name text-lg">Starting Point</span></a
>
<figure class="relative mt-auto grid gap-2">
<blockquote class="text-base font-medium">
“Simplicity is the ultimate sophistication.”
</blockquote>
<figcaption class="text-base text-white/70">Leonardo da Vinci</figcaption>
</figure>
</div>
<div class="flex items-center justify-center p-6 md:p-10">
<div class="flex w-full max-w-sm flex-col gap-6">
<a
href="#"
class="self-center text-foreground [&>svg]:size-7 lg:hidden"
aria-label="Starting Point"
><svg
xmlns="http://www.w3.org/2000/svg"
viewBox="4 4 16 16"
fill="currentColor"
>
<path
d="M6.5 16.5 16.5 6.5"
fill="none"
stroke="currentColor"
stroke-width="4"
stroke-linecap="round"
></path>
<circle cx="17" cy="17" r="2.5"></circle></svg
></a>
<div class="grid justify-items-center gap-2 text-center">
<h1 class="text-xl font-medium tracking-tight">
Log in to your account
</h1>
<p class="text-sm text-balance text-muted-foreground">
Enter your email and password below to log in
</p>
</div>
<button type="button" class="btn btn-outline">
<svg
class="icon-start"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
>
<path
fill="#4285F4"
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.27-4.74 3.27-8.1z"
></path>
<path
fill="#34A853"
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z"
></path>
<path
fill="#FBBC05"
d="M5.84 14.1A6.6 6.6 0 0 1 5.5 12c0-.73.13-1.44.34-2.1V7.07H2.18A11 11 0 0 0 1 12c0 1.78.43 3.45 1.18 4.93l3.66-2.84z"
></path>
<path
fill="#EA4335"
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1A11 11 0 0 0 2.18 7.07l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"
></path></svg
>Log in with Google
</button>
<div class="field-separator my-0">
<span class="text-xs uppercase">Or continue with email</span>
</div>
<form
id="split-login-page"
class="field-group"
action="/login"
method="post"
>
<div class="field">
<label class="label" for="split-login-page-email">Email address</label
><input
class="input"
id="split-login-page-email"
type="email"
placeholder="[email protected]"
autocomplete="email"
required=""
autofocus=""
name="email"
/>
</div>
<div class="field">
<div class="flex items-center">
<label class="label" for="split-login-page-password">Password</label
><a
href="#"
class="ms-auto text-sm underline-offset-4 hover:underline"
>Forgot your password?</a
>
</div>
<div class="input-group">
<input
class="input"
id="split-login-page-password"
type="password"
placeholder="Password"
autocomplete="current-password"
required=""
name="password"
/>
<div class="input-group-addon input-group-addon-end">
<button
type="button"
class="btn btn-ghost btn-xs btn-icon"
aria-label="Show password"
aria-pressed="false"
data-password-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="in-aria-pressed:hidden"
>
<path
d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"
></path>
<circle cx="12" cy="12" r="3"></circle></svg
><svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="hidden in-aria-pressed:block"
>
<path
d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"
></path>
<path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"></path>
<path
d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"
></path>
<path d="m2 2 20 20"></path>
</svg>
</button>
</div>
</div>
</div>
<div class="field field-horizontal">
<input
type="checkbox"
class="checkbox"
id="split-login-page-remember"
name="remember"
/>
<div class="field-content">
<label class="label" for="split-login-page-remember"
>Remember me</label
>
</div>
</div>
<button type="submit" class="btn">Log in</button>
<script>
{
const form = document.currentScript.closest("form");
for (const button of form.querySelectorAll(
"[data-password-toggle]",
)) {
button.addEventListener("click", () => {
const input = button
.closest(".input-group")
.querySelector("input");
const show = input.type === "password";
input.type = show ? "text" : "password";
button.setAttribute("aria-pressed", show);
});
}
}
</script>
</form>
<p
class="text-center text-sm text-muted-foreground [&_a]:font-medium [&_a]:text-foreground [&_a]:underline-offset-4 [&_a:hover]:underline"
>
Don't have an account? <a href="#">Sign up</a>
</p>
</div>
</div>
</div>