React Lamp Login
A dark stage with a pull cord: pull it and a warm light cone reveals a glass sign-in card. The card is always there for keyboards and screen readers.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/lamp-login.jsonPull the cord to switch the light on
Welcome back
Sign in to continue to your workspace.
New here? Create an account
LampLogindefaultLampLoginLabels
Pull the cord
Click the bead, press Enter or Space on it, or drag it down on a touch screen. Tabbing into the card also switches the light on. With reduced motion the light starts on.
Pull the cord to switch the light on
Welcome back
Sign in to continue to your workspace.
New here? Create an account
import { LampLogin } from "@/components/sheenui/blocks/lamp-login";
// Package build (after the first npm release, or a packed tarball): import { LampLogin } from "@sheenui/theme";
// Your call; throw to show the error under the form
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");
}
export function Example() {
return (
<LampLogin
onSubmit={async ({ email, password }) => {
await signIn(email, password);
}}
/>
);
}Files to copy
10 folders · 17 files · 4 packages
- From
theme/src/ blocks/{lamp-login.tsx, glass-login.tsx, icons.tsx}components/button/components/glass-card/components/input/components/spinner/components/status-icons/hooks/{use-controllable.ts, 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, warn-once.ts}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/lamp-login.jsonRegistry item: lamp-login. The styles need the Tailwind v4 glass UI setup.- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
Starts lit, with social buttons
defaultLit starts with the light on; onLitChange reports every switch. onSocial and the other GlassLogin options pass straight through.
Pull the cord to switch it off
import { LampLogin } from "@/components/sheenui/blocks/lamp-login";
// Package build (after the first npm release, or a packed tarball): import { LampLogin } from "@sheenui/theme";
export function Example() {
return (
<LampLogin
defaultLit
onLitChange={(lit) => console.log(lit ? "light on" : "light off")}
onSocial={(provider) => console.log(provider)}
title="Back in the studio"
subtitle="Sign in to pick up where you left off."
labels={{ cord: "Studio lamp" }}
/>
);
}Props
GlassLoginLabels keys and English defaults (15)
LampLoginLabels keys and English defaults (3)
Keyboard
Accessibility
- The cord is a real toggle button named by labels.cord; its pressed state says whether the light is on. The hint under the lamp is text.
- The card is always in the page and in tab order. The lamp, cone and dimming layer are aria-hidden: nothing is said by light alone.
- The stage is forced dark, so the glass and its text keep at least 4.5:1 contrast whatever the page theme.
- Reduced motion: the light starts on, the cord does not swing and the cone does not grow; pulling it still changes the light with a short fade.
All exports on this page
LampLogin— A sign-in card on a dark stage: a lamp with a pull cord.defaultLampLoginLabels— The English LampLoginLabels used when labels is omitted; a partial labels prop is merged over it.
When to use the lamp login form
- Use LampLogin as an animated login page for a product that wants one memorable first impression: a dark stage, a lamp with a pull cord, and a sign-in card that the light reveals.
- Use it for a portfolio, a game or a creative tool where the sign-in screen is part of the brand, and the form itself still needs real validation, a loading state and error messages.
- Use lit, defaultLit and onLitChange when the surrounding page needs to know whether the light is on, for example to start the stage already lit after a failed sign-in.
- Skip it for a plain admin sign-in where speed matters more than delight; GlassLogin is the same form without the stage.
- Pair it with GlassLogin options such as onSocial and forgotHref, which it passes straight through, and with useSheenReducedMotion if you add motion of your own around it.
Frequently asked questions
Related pages
20 blocks pages in all: browse them on All blocks.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .