Skip to content

Two-Button Accept/Reject

A copy-paste cookie & consent component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Cookie & ConsentHTMLCSSany framework
🛡️

We use cookies for analytics and to improve your experience.

Customise settings →

Copy into your project

HTML
<div class="nuda-ck-twobtn">
  <div class="nuda-ck-twobtn__icon">🛡️</div>
  <p class="nuda-ck-twobtn__msg">
    We use cookies for analytics and to improve your experience.
  </p>
  <div class="nuda-ck-twobtn__row">
    <button class="nuda-ck-twobtn__btn nuda-ck-twobtn__btn--reject">
      <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"
           stroke-linecap="round" width="10" height="10">
        <line x1="2" y1="2" x2="14" y2="14" />
        <line x1="14" y1="2" x2="2" y2="14" />
      </svg>
      Reject All
    </button>
    <button class="nuda-ck-twobtn__btn nuda-ck-twobtn__btn--accept">
      <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2.5"
           stroke-linecap="round" stroke-linejoin="round" width="10" height="10">
        <polyline points="2,8 6,12 14,4" />
      </svg>
      Accept All
    </button>
  </div>
  <a class="nuda-ck-twobtn__more" href="#">Customise settings &rarr;</a>
</div>
CSS
.nuda-ck-twobtn {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  width: 230px;
  text-align: center;
  animation: _nuda-cktwobtnIn .45s cubic-bezier(.16,1,.3,1) both;
}

.nuda-ck-twobtn__icon {
  font-size: 1.6rem;
  margin-bottom: .55rem;
}

.nuda-ck-twobtn__msg {
  color: #cfcfcf;
  font-size: .73rem;
  line-height: 1.5;
  margin: 0 0 .9rem;
}

.nuda-ck-twobtn__row {
  display: flex;
  gap: .5rem;
  margin-bottom: .6rem;
}

.nuda-ck-twobtn__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  border: none;
  border-radius: 9px;
  padding: .5rem 0;
  font-size: .73rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}

.nuda-ck-twobtn__btn:hover {
  opacity: .8;
}

.nuda-ck-twobtn__btn--reject {
  background: rgba(255,107,107,.12);
  color: #ff6b6b;
  border: 1px solid rgba(255,107,107,.25);
}

.nuda-ck-twobtn__btn--accept {
  background: #e4ff54;
  color: #0a0a0a;
}

.nuda-ck-twobtn__more {
  color: #555;
  font-size: .68rem;
  text-decoration: none;
}

.nuda-ck-twobtn__more:hover {
  color: #cfcfcf;
}

@keyframes _nuda-cktwobtnIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-ck-twobtn {
    animation: none;
  }
}

How to use Two-Button Accept/Reject

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More cookie & consent components

← Browse all NudaUI components