React Glass Login Page
A glassmorphism login form for React with validation, a password reveal, a loading state and social sign-in buttons, built from SheenUI's Button, GlassCard and Input.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/glass-login.jsonWelcome back
Sign in to continue to your workspace.
New here? Create an account
GlassLogindefaultGlassLoginLabels
Sign in
Try submitting empty, then with any email and an 8+ character password.
import { GlassLogin } from "@/components/sheenui/blocks/glass-login";
// Package build (after the first npm release, or a packed tarball): import { GlassLogin } from "@sheenui/theme";
// Your auth calls; signIn throws on failure so the card shows the error
async function signIn(email: string, password: string) {
const res = await fetch("/api/sign-in", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ email, password }),
});
if (!res.ok) throw new Error("Wrong email or password");
}
function startOAuth(provider: "github" | "google") {
window.location.assign("/auth/" + provider);
}
export function Example() {
return (
<GlassLogin
onSubmit={async ({ email, password }) => {
await signIn(email, password);
}}
onSocial={(provider) => startOAuth(provider)}
/>
);
}Files to copy
10 folders · 14 files · 4 packages
- From
theme/src/ blocks/{glass-login.tsx, icons.tsx}components/button/components/glass-card/components/input/components/spinner/components/status-icons/hooks/{use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}motion/{gate.ts, light-follower.ts, tokens.ts}lib/{cn.ts, field-size.ts, form.ts, heading.ts, state-light.tsx}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/glass-login.jsonRegistry item: glass-login. The styles need the Tailwind v4 glass UI setup.- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
Your copy, a stricter rule, a failing sign-in
Change the heading and the line under it, require 12 characters, hide the sign-up link and leave out the social buttons (they only show when onSocial is given). This one always fails, so you can see the error.
Sign in to Acme
Use your work email.
import { GlassLogin } from "@/components/sheenui/blocks/glass-login";
// Package build (after the first npm release, or a packed tarball): import { GlassLogin } from "@sheenui/theme";
<GlassLogin
title="Sign in to Acme"
subtitle="Use your work email."
minPasswordLength={12}
signUpHref={null}
onSubmit={async () => {
throw new Error("Wrong email or password"); // the card shows the error and stays editable
}}
/>Props
GlassLoginLabels keys and English defaults (15)
Keyboard
Accessibility
- A real <form> with noValidate and visible error text linked to its field (aria-describedby).
- A failed check moves focus to the first invalid field once its message is linked, and the message is announced.
- The reveal button has a state-aware name (“Show password” / “Hide password” by default).
- Targets are at least 44 px on touch devices.
All exports on this page
GlassLogin— A sign-in card: email and password with show/hide, inline validation, a loading state, optional GitHub and Google buttons and a sign-up link.defaultGlassLoginLabels— The English GlassLoginLabels used when labels is omitted; a partial labels prop is merged over it.
When to use the glass login form
- Use GlassLogin as a glassy login page for a SaaS dashboard, where one frosted card with email, password and a forgot-password link sits over an aurora or gradient background. Use it as a liquid glass login form when the sign-in screen sits over a SheenBackdrop.
- Use it inside a modal or drawer when a signed-out visitor clicks a gated action, such as saving a design or posting a comment, and you want sign-in without leaving the page.
- Use it for an internal admin tool that needs only email and password plus optional GitHub and Google buttons, with the built-in strings translated through the labels prop and the heading through title and subtitle.
- Skip it when sign-up and sign-in share one screen with a brand panel and password-strength feedback; AuthSplit covers that layout, while GlassLogin only links out to a sign-up page.
- Pair it with SheenBackdrop for the aurora behind the card, the Input component for any extra fields you add around it, and useSheenReducedMotion if you animate the page behind the card.
Frequently asked questions
Related pages
Guides that cover it
20 blocks pages in all: browse them on All blocks.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .