Skip to content

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.json

Welcome back

Sign in to continue to your workspace.

New here? Create an account

Sign in

Try submitting empty, then with any email and an 8+ character password.

Welcome back

Sign in to continue to your workspace.

or continue with

New here? Create an account

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.

Props

PropTypeDefaultDescription
titleReactNode"Welcome back"Sets the heading (ReactNode, default "Welcome back").
subtitleReactNode"Sign in to continue to your workspace."The line under the heading (ReactNode, default "Sign in to continue to your workspace.").
onSubmit((values: GlassLoginValues) => void | Promise<void>)NoneCalled with the form values. Return a promise to show a loading state; throw to show an error.
onSocial((provider: "github" | "google") => void)NoneShow "Continue with GitHub / Google" buttons. Without it the social row is hidden.
forgotHrefstring"#"Target of the "Forgot password?" link (string, default "#").
signUpHrefstring | null"#"Target of the sign-up link (string | null, default "#"). Hide the sign-up line by passing null.
minPasswordLengthnumber8Minimum password length checked before submitting (number, default 8).
labelsPartial<GlassLoginLabels>defaultGlassLoginLabelsEvery other string, for translation: labels={{ email: "…" }}; omitted keys keep the English of defaultGlassLoginLabels. All 15 keys of GlassLoginLabels are listed in the key table under the props table.
headingLevelHeadingLevelOption2Level of the title heading (1 to 6, default 2); set it to fit the page's outline. "none" renders a paragraph with no heading role (for an example).
classNamestringNoneAdds extra classes to the outer glass card (string).
GlassLoginLabels keys and English defaults (15)
Pass any key in labels; the rest keep the defaults of defaultGlassLoginLabels.
KeyEnglish default
emailEmail
emailPlaceholderyou@example.com
passwordPassword
showPasswordShow password
hidePasswordHide password
forgotForgot password?
submitSign in
divideror continue with
githubGitHub
googleGoogle
signUpPromptNew here?
signUpCreate an account
invalidEmailEnter a valid email address.
shortPassword(min) => `Password must be at least ${min} characters.`
genericErrorSomething went wrong. Try again.

Keyboard

KeysAction
TabEmail, password, the reveal button, the forgot link, submit, the social buttons, then the sign-up link.
EnterSubmit the form.

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

20 blocks pages in all: browse them on All blocks.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .