A bold Bootstrap 6 account card that puts Sign in and Create account behind one segmented tab control. Visitors switch forms without leaving the page. It uses an amber header, a hard black offset shadow and a dark primary button, and it fits as the account page of a SaaS product, an online shop or a community site.
How it works
.lst-root centers one .lst-card. The amber .lst-top header holds the brand and a ul.nav.nav-pills.lst-tabs with role="tablist". Each tab is a <button class="nav-link" data-bs-toggle="tab" data-bs-target="#…"> with role="tab", aria-controls and aria-selected, so the Bootstrap 6 Tab plugin works through the data API with no init code. The panes live in .tab-content: #lst-signin starts with tab-pane show active, and Bootstrap 6 fades panes on its own, so no .fade class is needed. CSS turns the pills into a two-column segmented control, and the active tab becomes a white chip.
script.js does two jobs. First, the "Create one" and "Sign in" links at the bottom of each pane (.lst-goto with data-lst-goto) call Tab.getOrCreateInstance(trigger).show(). After shown.bs.tab, focus moves to the first field of the new form. Second, every .lst-form is validated on submit with checkValidity(). Invalid fields and the terms .check get .is-invalid and aria-invalid, and Bootstrap 6 shows the sibling .invalid-feedback. A valid form shows a spinner, waits for a simulated request, resets, and shows the .lst-done success alert. The text depends on data-lst-form (signin or signup).
Customization
--lst-amber,--lst-amber-deepand--lst-inkon.lst-root: change the header color, link color and the black outline, shadow and button. They are mapped to--bs-primary-*,--bs-control-checked-bgand--bs-focus-ring.box-shadow: 8px 8px 0on.lst-card: remove it, or use a soft shadow, for a calmer look.- Swap the
activeclass,aria-selectedandtabindexbetween the two tab buttons, andshow activebetween the panes, to open on Create account. - Add a third pane, such as "Magic link", with one more
nav-itemandtab-pane. Changegrid-template-columnsin.lst-tabstorepeat(3, 1fr). - Replace the
setTimeoutin the submit handler withfetch('/api/' + form.dataset.lstForm, …)to post to your login and signup endpoints. minlength="8"on#lst-up-password: change the password rule, together with its.form-textand feedback.
Use cases
- SaaS products: one card switches between Sign in and Create account without a page reload
- Online shops: a single account page handles both returning and new customers
- Community sites: cross-links let visitors move between the two forms
- Account pages: each form validates input and runs a simulated submit
Accessibility
The tablist, tabs and tabpanels use the WAI-ARIA tabs pattern. Bootstrap updates aria-selected and moves focus with the arrow keys, and inactive tabs get tabindex="-1". Panes are focusable with a visible dashed outline. Every input has a visible label, errors set aria-invalid, and success messages use role="status". The button press effect is turned off under prefers-reduced-motion.
Bootstrap 6 notes
Tab markup is the same as in Bootstrap 5. The trigger must sit inside a .nav or [role=tablist], or the alpha.1 plugin throws. Panes no longer need .fade. btn-solid theme-primary replaces the old primary button class, .form-field replaces mb-3 wrappers, and checkboxes are a single .check. Built on Bootstrap 6.0.0-alpha.1, so class names may still change. IDs are fixed, so give each copy unique IDs if you use the card twice on a page.