Skip to content

Mega Footer with Accordion on Mobile

Large Bootstrap 6 footer whose five link columns turn into an exclusive details accordion on phones, with brand block, stats strip, CTA and legal bar.

Also known as: mega footer, large website footer, footer with accordion on mobile, five column footer

Mega Footer with Accordion on Mobile live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

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 name is removed and every <details> is forced open. The summary gets role="heading", aria-level="2" and tabindex="-1", and a click listener calls preventDefault() 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-accent and --mfa-accent-strong on .mfa-root: change the top border, logo, open accordion titles, badges and the "Find a charger" button.
  • --mfa-bg, --mfa-ink, --mfa-muted and --mfa-line on .mfa-root: adjust the paper background, text and dividers.
  • Change min-width: 768px in script.js and the matching @media (min-width: 768px) block in style.css to switch the layout at another breakpoint.
  • Remove the name logic in apply() if several accordion items may be open at once on mobile.
  • Change repeat(5, minmax(0, 1fr)) on .mfa-accordion when you add or remove columns.
  • Delete .mfa-wordmark or change its text and gradient to match your brand. It is decorative and aria-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.

Mega Footer with Accordion on Mobile at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Footers
License
Free for personal and commercial use

Questions about this template

Can I use the Mega Footer with Accordion on Mobile code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Mega Footer with Accordion on Mobile – Bootstrap 6 footers component screenshot
Mega Footer with Accordion on Mobile · Bootstrap 6 Footers

More Footers

Simple Centered Footer – Pure CSS footers preview

Simple Centered Footer

Minimal centered footer in pure CSS with a logo, tagline, links with animated underlines, round icon links and an auto-updating copyright year.

Dark Footer with App Badges – Tailwind CSS footers preview

Dark Footer with App Badges

Dark Tailwind CSS footer with four link columns, App Store and Google Play badges, and a language select that remembers the choice.

Footer with Newsletter – Bootstrap 5 footers preview

Footer with Newsletter

Dark Bootstrap 5 footer with a newsletter signup panel, email validation, social icons, three link columns and a legal bar.

Multi-Column Footer – Tailwind CSS footers preview

Multi-Column Footer

Dark Tailwind CSS website footer with brand block, social icons, four labelled link columns and a bottom bar with copyright and status.

Footer with App Download Buttons – Bootstrap 6 footers preview

Footer with App Download Buttons

Bootstrap 6 footer with a green app promo panel: generic iOS and Android download buttons, QR code, CSS phone mockup, link columns and a region Combobox.

Dark Footer with Contact Info – Bootstrap 6 footers preview

Dark Footer with Contact Info

Dark Bootstrap 6 footer with address, phone and email cards, copy-to-clipboard Toast, live open/closed hours badge, link columns and a language Menu.