Skip to content
Added 2 Sept 2026
Back to library
cookie-consent-overlay-15721
Cookie Consent Overlay
Modals & Overlays

Cookie Consent Overlay

Dimmed page with a consent bar pinned across its foot that grows upward on hover to unfold three category switches above the accept action.

Modals & Overlaysconsentcookiesbanneroverlayexpand
lines of CSS
74lines of CSS
dependencies
0dependencies
baseline browsers
Newlybaseline browsers
motion only on interaction
Hovermotion only on interaction
Backdrop
Open a live copy in

Vue, Svelte, styled-components and Tailwind exports are part of Pro. HTML, CSS and React are free forever.

cookie-consent-overlay-15721.css
.fx-v14-mo-consent-15720 {
  position: relative;
  width: 250px;
  height: 152px;
  padding: 12px;
  background: #0e1626;
  border: 1px solid #22304b;
  border-radius: 0.75rem;
  overflow: hidden;
}
.fx-v14-mo-consent-15720 .l { display: block; height: 8px; margin-bottom: 10px; border-radius: 4px; background: #1a2437; }
.fx-v14-mo-consent-15720 .l:nth-child(1) { width: 55%; height: 12px; background: #22304b; }
.fx-v14-mo-consent-15720 .l:nth-child(2) { width: 92%; }
.fx-v14-mo-consent-15720 .l:nth-child(3) { width: 78%; }
.fx-v14-mo-consent-15720 .sc { position: absolute; inset: 0; background: rgba(2,6,23,0.55); backdrop-filter: blur(1.5px); }
.fx-v14-mo-consent-15720 .bar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 0.45rem 0.55rem;
  background: #16203a;
  border: 1px solid #2f3d5c;
  border-radius: 0.55rem;
  box-shadow: 0 14px 30px rgba(0,0,0,0.6);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.fx-v14-mo-consent-15720 .bar p { margin: 0; font-size: 0.62rem; line-height: 1.3; color: #cbd5e1; }
.fx-v14-mo-consent-15720 .more {
  display: grid;
  gap: 4px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.35s ease;
}
.fx-v14-mo-consent-15720 .more span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.58rem;
  line-height: 1.2;
  color: #94a3b8;
}
.fx-v14-mo-consent-15720 .more u { position: relative; width: 20px; height: 11px; border-radius: 999px; background: #2f3d5c; }
.fx-v14-mo-consent-15720 .more u::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}
.fx-v14-mo-consent-15720 .more .on { background: #34d399; }
.fx-v14-mo-consent-15720 .more .on::after { left: 11px; background: #052e16; }
.fx-v14-mo-consent-15720 .act { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-top: 0.4rem; }
.fx-v14-mo-consent-15720 .act em { font-style: normal; font-size: 0.62rem; color: #94a3b8; cursor: pointer; }
.fx-v14-mo-consent-15720 .act button {
  padding: 0.24rem 0.55rem;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  color: #041225;
  background: #38bdf8;
  border: none;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.fx-v14-mo-consent-15720:hover .bar { transform: translateY(-2px); border-color: #3f5d86; }
.fx-v14-mo-consent-15720:hover .more { max-height: 52px; opacity: 1; margin-top: 0.35rem; }
.fx-v14-mo-consent-15720:hover .act button { background: #7dd3fc; box-shadow: 0 4px 14px rgba(56,189,248,0.35); }
cookie-consent-overlay-15721.html
<div class="fx-v14-mo-consent-15720">
  <i class="l"></i>
  <i class="l"></i>
  <i class="l"></i>
  <div class="sc"></div>
  <div class="bar">
    <p>We use cookies to measure traffic.</p>
    <div class="more">
      <span>Essential<u class="on"></u></span>
      <span>Analytics<u></u></span>
      <span>Marketing<u></u></span>
    </div>
    <div class="act">
      <em>Manage</em>
      <button>Accept all</button>
    </div>
  </div>
</div>

What do I do with this?

  1. Put cookie-consent-overlay-15721.css anywhere your page already loads CSS from — in Next.js that is app/globals.css, or any stylesheet with a <link> in your HTML.
  2. Then put the class on the element you want it on: <button class="fx-v14-mo-consent-15720">. The CSS does nothing until a class name in it matches something on the page.
  • Link the stylesheet, then paste the markup wherever you need it.
npx hoverlab add cookie-consent-overlay-15721

What's included

  • The markup and the stylesheet, in whichever framework you pick
  • No runtime dependencies

Works with

  • React
  • Vue
  • Svelte
  • Tailwind
  • styled-components
  • Plain CSS

npx hoverlab add cookie-consent-overlay-15721

Or over MCP, from your editor's agent — no account needed.

License

Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.

Was this useful?

Motion safety

Static estimate, read from the CSS

Reduced motion
Brief motion, no guard

Animates briefly or on interaction. Only looping motion gets a guard in this catalog; copy the one from the Insights tab if this ships on a critical path.

What it animates
Reflows

Animates margin-top, max-height (and background, border-color, box-shadow). The browser re-lays-out the page on every frame; prefer transform if you can.

Flashing (WCAG 2.3.1)
No flashing found

No repeating change in opacity, colour or brightness large enough to count as a flash.

Layout shift (CLS)
May shift layout

Animates margin-top, max-height on a box in flow, so content beside or after it can move. Measured in Chromium: layout-shift score 0.0010 across 8 shifts in 5.8 s, one preview with a neighbour beside it. Not a page-level CLS.

Every row is read from the shipped CSS. Only a figure marked measured came from a browser. Customizing the speed changes the timing, so recheck a customized copy. How it is computed

30 more effects in Modals & Overlays

All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.

Browse Modals & Overlays

Shipping one commercially

Copying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.

  • A commercial licence for everything in the catalog
  • Unlimited bundle exports, in Vue, Svelte and Tailwind
  • One payment — no subscription, nothing to renew
Pro — $79 once

7 variations of Cookie Consent Overlay

Finished looks, each one a position in the customizer above. Copy any of them, or open it and keep moving the sliders.