A large Bootstrap 6 mega footer with five link columns that turn into an accordion on phones. On desktop the columns sit next to a brand block, and below them come a dark stats strip with a call to action, a legal bar and an oversized faded wordmark. It suits product companies, marketplaces and documentation-heavy sites with many footer links.
How it works
Each link column is a native <details class="accordion-item mfa-col"> inside .accordion.accordion-flush.mfa-accordion. This is the Bootstrap 6 accordion, which needs no JavaScript to open and close. The <summary class="accordion-header"> holds the column title and an .accordion-icon chevron, and the .accordion-body is a <nav> labelled by that title.
script.js uses matchMedia('(min-width: 768px)'):
- Below 768px every column closes and gets a shared
name(mfa-group-0, unique per footer instance), so the browser keeps only one column open at a time. - From 768px the
nameis removed and every<details>is forced open. The summary getsrole="heading",aria-level="2"andtabindex="-1", and a click listener callspreventDefault()so the column cannot be collapsed. CSS hides the chevron and lays the columns out in a grid: three per row on tablets and five beside the brand from 1024px.
The script re-runs when the media query changes, so resizing works. All columns start with open in the HTML, so without JavaScript every link is still visible. The script also writes the current year into .mfa-year.
Customization
--mfa-accentand--mfa-accent-strongon.mfa-root: change the top border, logo, open accordion titles, badges and the "Find a charger" button.--mfa-bg,--mfa-ink,--mfa-mutedand--mfa-lineon.mfa-root: adjust the paper background, text and dividers.- Change
min-width: 768pxinscript.jsand the matching@media (min-width: 768px)block instyle.cssto switch the layout at another breakpoint. - Remove the
namelogic inapply()if several accordion items may be open at once on mobile. - Change
repeat(5, minmax(0, 1fr))on.mfa-accordionwhen you add or remove columns. - Delete
.mfa-wordmarkor change its text and gradient to match your brand. It is decorative andaria-hidden.
Use cases
- Product companies: five link columns sit beside a brand block on desktop
- Marketplaces: a dark stats strip with a call to action sits below the links
- Documentation-heavy sites: link columns become an accordion on phones, with one section open at a time
- Corporate sites: a legal bar and large faded wordmark finish the page
Accessibility
On phones each summary is a native disclosure button that works with Enter and Space, and the open state is announced automatically. On desktop the titles act as headings, are removed from the tab order and label their <nav> regions. Icon-only social links have aria-labels, and links show a visible focus outline. Bootstrap's accordion animation respects prefers-reduced-motion.
Bootstrap 6 notes
Built on Bootstrap 6.0.0-alpha.1, so alpha APIs can still change. The Bootstrap 5 accordion with accordion-button, accordion-collapse and data-bs-parent is replaced by native <details>/<summary>, and a shared name attribute does the job data-bs-parent used to. Buttons use btn-solid theme-primary and btn-outline theme-secondary. Icons come from Bootstrap Icons.