CCPA Do Not Sell Notice
A copy-paste cookie & consent component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Cookie & ConsentHTMLCSSany framework
California residents have the right to opt out of the sale or sharing of personal information.
Learn about your CCPA rightsCopy into your project
HTML
<div class="nuda-ck2-ccpa" role="region" aria-label="California privacy notice">
<p class="nuda-ck2-ccpa__text">
California residents have the right to opt out of the sale or sharing of personal information.
</p>
<div class="nuda-ck2-ccpa__row">
<input type="checkbox" id="ck2-ccpa-toggle" class="nuda-ck2-ccpa__input">
<label for="ck2-ccpa-toggle" class="nuda-ck2-ccpa__switch" aria-hidden="true">
<span class="nuda-ck2-ccpa__thumb"></span>
</label>
<label for="ck2-ccpa-toggle" class="nuda-ck2-ccpa__label">Do Not Sell or Share My Info</label>
</div>
<a class="nuda-ck2-ccpa__link" href="#">Learn about your CCPA rights</a>
</div>CSS
.nuda-ck2-ccpa {
width: 300px;
box-sizing: border-box;
background: #141414;
border: 1px solid rgba(255,255,255,.1);
border-radius: 14px;
padding: 1rem 1.1rem;
box-shadow: 0 18px 45px rgba(0,0,0,.5);
animation: _nuda-ck2ccpaIn .45s cubic-bezier(.16,1,.3,1) both;
}
.nuda-ck2-ccpa__text {
color: #cfcfcf;
font-size: .72rem;
line-height: 1.55;
margin: 0 0 .8rem;
}
.nuda-ck2-ccpa__row {
position: relative;
display: flex;
align-items: center;
gap: .55rem;
margin-bottom: .65rem;
}
.nuda-ck2-ccpa__input {
position: absolute;
width: 36px;
height: 44px;
left: -6px;
top: 50%;
transform: translateY(-50%);
margin: 0;
opacity: 0;
cursor: pointer;
}
.nuda-ck2-ccpa__switch {
position: relative;
display: inline-flex;
width: 34px;
height: 19px;
border-radius: 999px;
background: rgba(255,255,255,.15);
flex-shrink: 0;
transition: background .2s;
}
.nuda-ck2-ccpa__thumb {
position: absolute;
top: 2px;
left: 2px;
width: 15px;
height: 15px;
border-radius: 50%;
background: #fafafa;
transition: transform .2s;
}
.nuda-ck2-ccpa__input:checked ~ .nuda-ck2-ccpa__switch {
background: #e4ff54;
}
.nuda-ck2-ccpa__input:checked ~ .nuda-ck2-ccpa__switch .nuda-ck2-ccpa__thumb {
transform: translateX(15px);
background: #0a0a0a;
}
.nuda-ck2-ccpa__input:focus-visible ~ .nuda-ck2-ccpa__switch {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
.nuda-ck2-ccpa__label {
color: #fafafa;
font-size: .73rem;
font-weight: 600;
cursor: pointer;
}
.nuda-ck2-ccpa__link {
display: inline-block;
color: #e4ff54;
font-size: .68rem;
text-decoration: underline;
text-underline-offset: 2px;
}
.nuda-ck2-ccpa__link:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
@keyframes _nuda-ck2ccpaIn {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: none;
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-ck2-ccpa {
animation: none !important;
}
}
How to use CCPA Do Not Sell Notice
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.