A light, indigo-accented sign-in popup built on the Bootstrap 6 Dialog component: three social sign-in buttons, an email and password form with a show-password toggle, a "keep me signed in" checkbox and a success screen. Use it on SaaS landing pages, dashboards or any site that signs users in without leaving the current page.
How it works
The root .lgd-root holds a small demo page (brand, links and a "Sign in" button) and a native <dialog class="dialog dialog-slide-up lgd-dialog">. The button opens it through the Bootstrap 6 data API with data-bs-toggle="dialog", and the close button uses data-bs-dismiss="dialog". Bootstrap handles the backdrop, the Escape key, focus trapping and returning focus to the trigger. Native autofocus puts the cursor in the email field.
Inside .lgd-body there are two panes. .lgd-pane--form holds the .lgd-social button group (data-lgd-provider names the provider), a text divider and .lgd-form. .lgd-pane--done is the hidden success state.
script.js validates on submit: invalid fields get .is-invalid and aria-invalid, and Bootstrap shows the sibling .invalid-feedback. The password feedback works inside .input-group because it sits in the same .form-field. .lgd-reveal switches the password field between password and text and updates aria-pressed. A valid submit shows the spinner and then the success pane. Provider buttons write "Redirecting to …" into the .lgd-status live region. When hidden.bs.dialog fires, the form resets.
Customization
--lgd-accenton.lgd-rootinstyle.css: the brand color. It also feeds--bs-primary-bgand--bs-control-checked-bg, so the Sign in button and the checkbox follow it.--bs-dialog-widthon.lgd-dialog: change25.5remfor a wider or narrower popup.--bs-dialog-backdrop-bgand--bs-dialog-backdrop-bluron.lgd-dialog: the tint and blur behind the dialog.- Add or remove
.lgd-providerbuttons and setgrid-template-columnson.lgd-socialto match the number of providers. - Replace the
setTimeoutin the submit handler withfetch('/api/login', …), and start your OAuth redirect in the provider click handler. - Remove
data-lgd-autoopenfrom.lgd-rootso the dialog only opens from the button (the attribute opens it on load for the preview).
Use cases
- SaaS landing pages: visitors sign in from a popup without leaving the current page
- Dashboards: Google, Apple and GitHub buttons sit above an email and password form
- Membership sites: a show-password toggle and a keep me signed in checkbox reduce login friction
- Web apps: a success screen confirms the sign-in inside the same dialog
Accessibility
The dialog has aria-labelledby and aria-describedby. Icon buttons have aria-labels ("Continue with Google", "Show password"), and their icons are aria-hidden. Errors use aria-invalid and visible messages, and focus moves to the first invalid field. Status text is announced through role="status". The success heading receives focus so screen readers announce it. Bootstrap's dialog transition is turned off when the user prefers reduced motion.
Bootstrap 6 notes
This is built on Bootstrap 6.0.0-alpha.1, and alpha APIs can still change. The BS5 .modal markup becomes <dialog class="dialog"> with dialog-body and data-bs-dismiss="dialog". btn btn-primary becomes btn-solid theme-primary, and outline buttons use btn-outline theme-secondary. form-check becomes a bare .check inside .form-field, and buttons inside an input group get input-group-btn. The script imports Dialog from the bundle URL; there is no window.bootstrap.