About this set
A sign-in dialog that opens over the application when a session expires, so people can re-authenticate without losing their place. The dialog shows a Session expired tag, a heading, a line saying the work is saved, the account email as a read-only field, a password field that receives focus, an Unlock button and a quieter Sign in as someone else button. Behind it the app is dimmed and blurred. In plain CSS and Tailwind it is a native dialog element opened with showModal(), which makes the rest of the page inert, traps focus inside and paints the ::backdrop that does the dimming and blur. Escape is blocked with closedby=”none” and a cancel handler, because closing would show an expired session; signing in or switching account are the ways out. The Bootstrap version uses the .modal component and bundle JavaScript with the backdrop and keyboard close switched off, and moves focus to the password field once shown. The blurred dashboard in the demo is a stand-in for your own app and is not part of the snippet.
What’s included
- Native dialog with showModal(), inert background and focus trap
- Backdrop dims and blurs whatever page sits behind
- Escape cannot dismiss an expired-session prompt
- Read-only account email with the password field focused
- Bootstrap version built on .modal with a static setup
Accessibility
The dialog is labelled by its heading and described by the saved-work line. Focus starts in the password field and stays inside the dialog; Tab reaches Unlock and Sign in as someone else, both with a 2px outline, and the fields show a brand ring. The page behind is inert while the dialog is open, and transitions are removed under prefers-reduced-motion.
Customise it
Change --lf-brand, --lf-muted and --lf-edge on .lf-dialog (plain CSS) or .lf-modal (Bootstrap), or the --color-* theme values (Tailwind). The dim and blur are the ::backdrop rule, the .lf-modal background, or the backdrop: utilities.




















