ThatDesignUIOriginalInteractive preview
Cookie consent and preferences
An honest cookie banner with equal Reject and Accept buttons, a preferences dialog with locked essentials, per-category switches and details, and a small settings button afterwards.
- Category
- Privacy
- Platform
- Responsive
Interactive componentClick through it, resize it, or switch states. It’s real UI, not a screenshot.Banner state
Use this component
Free to use. It works on its own in any React and Tailwind project, so you can add it with one command, paste the code, or hand the prompt to your coding agent.
FreeReact 18+Tailwind v3.4 or v4No extra packages
1. Add it with the shadcn CLI
npx shadcn@latest add https://www.thatdesignui.com/r/cookie-consent.json2. Use it
Every prop is optionalapp/page.tsx
import CookieConsent from "@/components/cookie-consent";
export default function Page() {
return <CookieConsent />;
}Prefer to paste it yourself? Open the .
Under the hood
How it’s built
What’s inside
- A warm website (#f7f3ee) with a floating white banner at the bottom (22px radius): a cookie icon tile, 'Your privacy, your call', one plain sentence, then Customize, and outlined Reject all and solid Accept all buttons of equal size.
- Customize opens a 34rem dialog over a dimmed page: each category has a name, a one-line description, a 'What this sets' disclosure listing cookies in mono, and a switch; Strictly necessary is locked on with an 'Always on' tag.
- After a choice a pill button 'Cookie settings · 1/3 on' stays at the bottom left and a dark toast confirms the choice.
How it behaves
- No optional category is on until the visitor turns it on or chooses Accept all.
- Reject all and Accept all are the same size and weight.
- The dialog traps Tab, closes on Escape, and the strictly necessary switch can't be changed.
- After saving, Cookie settings reopens the dialog with the saved choices.



