Cookie Consent Banner Design
A cookie banner has to collect real consent without wrecking the first impression. The best banners are short, honest and make accepting and rejecting equally easy.
By Mohamed Farhan · Updated Oct 19, 2026
We use cookies to keep the site working and, with your OK, to understand how it's used. Cookie policy
Inside the example
The live example above is plain HTML with Tailwind utility classes, so you can paste it into any Tailwind project. It uses type sizes text-sm (14px) and spacing p-5 (20px), mt-4 (16px), gap-2 (8px), px-4 (16px), py-2 (8px), constrained by max-w-xl. Everything sits on a 4px grid, which keeps rhythm consistent when you adapt it.
Colors use Tailwind's neutral stone scale so the pattern stays brand-agnostic. Swap stone-900 for your primary color on the main action, keep body text dark and check contrast after any change.
Anatomy
- 1.Short message
- One or two sentences on what you use cookies for.
- 2.Accept and reject
- Equal visual weight in most privacy regimes.
- 3.Preferences
- A way to choose categories.
- 4.Policy link
- Link to the full cookie policy.
Common variations
- Bottom bar banner, a compact strip along the bottom of the screen.
- Corner box, a small card in a corner that covers less content.
- Modal consent, a centered dialog that must be answered, used where regulations or the site's risk profile require explicit consent before any tracking.
- Layered consent, a simple first layer with Accept, Reject and Choose, and a detailed second layer with categories and vendors.
States to design
- First visit: banner visible with clear choices.
- Preferences open: categories with descriptions and toggles, necessary cookies locked on.
- Choice saved: banner disappears and the choice is remembered.
- Change later: a footer link reopens preferences.
A walkthrough
A visitor from Germany opens a SaaS blog post. A compact banner at the bottom explains in one sentence that the site uses cookies to keep it working and, with permission, to measure which articles are useful. Accept all and Reject all buttons have the same style and size, with a Choose link beside them.
He chooses Reject all. The banner disappears, no analytics scripts load, and the article is fully readable. A week later he decides to help the team and opens Cookie settings from the footer, where he enables analytics only. His choice is remembered across visits, and he is never asked again unless the categories change.
How different products use it
Content and media sites that rely on advertising often need detailed vendor lists and granular choices to meet regulations.
SaaS marketing sites usually only need analytics and marketing categories, so a simple banner with a preferences panel is enough.
Privacy-focused products may avoid non-essential cookies entirely and skip the banner, which can become a selling point.
Visual design guidelines
Keep the banner compact: two short lines of text and buttons in one row on desktop, stacked on mobile. Give Accept and Reject the same size and style where regulations expect equal prominence. Use your normal surface color and typography so the banner feels part of the site, and keep it clear of important controls like chat widgets.
Best practices
Do
- Give 'Reject all' the same prominence as 'Accept all' where regulations require it.
- Remember the choice and do not ask again on every page.
- Keep the banner compact, ideally at the bottom.
- Let users change their choice later from the footer.
Don't
- Do not pre-tick optional categories.
- Do not cover the whole page with a consent wall unless legally required.
- Do not use confusing double negatives.
On mobile
On mobile, banners easily cover half the screen. Keep the text to two short lines, place buttons side by side or stacked with equal size, and avoid fixed-height containers that clip content when text is enlarged.
Common mistakes
- Making reject harder than accept, which regulators in many regions consider manipulative.
- Pre-ticked optional categories.
- Loading tracking scripts before consent.
- Asking again on every page because the choice is not saved.
Edge cases to plan for
- Users who block storage may see the banner repeatedly; handle this gracefully.
- Embedded content like videos may need consent before loading; show a placeholder with a consent button.
- Different regions may need different defaults and wording.
- Consent changes should take effect immediately, including removing cookies where possible.
Accessibility checklist
- Make the banner reachable by keyboard right after page load.
- Do not trap focus unless it is a true modal.
- Ensure button text describes the action ('Reject all', not 'No').
Implementation notes
Store the user's choice in a first-party cookie or local storage and gate analytics and marketing scripts on it. Make the banner a region with an accessible name, ensure it is reachable by keyboard, and only trap focus if it is a true modal. Many sites use a consent management platform to handle regional rules.
In your design system
In a design system, the consent banner combines a surface, short text, buttons and a link, with a preferences dialog built from switches and descriptions. Define equal-weight button variants for Accept and Reject, and reuse your standard dialog component for the preferences layer so focus handling and keyboard behaviour are already solved.
How to measure whether it works
Track consent rates per choice, but focus on compliance rather than maximizing acceptance. Check that scripts only fire after consent, and periodically audit which cookies are actually set.
Pre-launch checklist
Microcopy you can use
A step-by-step design process
- Audit every cookie and script on the site and group them into categories.
- Decide what needs consent in each region you serve.
- Design the first layer with short text and equal choices.
- Design the preferences layer with category descriptions and toggles.
- Block scripts until consent and test that it really works.
- Add a permanent link in the footer to change preferences.
Usability test tasks
Before shipping, run a short usability test with five or so people from your audience. Give them tasks rather than instructions and watch where they hesitate:
- Reject all optional cookies.
- Allow analytics but not marketing cookies.
- Change your choice later.
- Find out what analytics cookies are used for.
Key terms
- Consent management platform: A tool that collects and stores cookie consent.
- Necessary cookies: Cookies required for the site to function, which usually do not need consent.
- Opt-in: Nothing is enabled until the user agrees.
- Dark pattern: Design that tricks users into choices they did not intend.
Writing the copy
Be specific and honest: say what cookies are used for in plain language, such as measuring which pages are useful. Avoid euphemisms like 'to improve your experience' with no detail. Button labels should describe the outcome: 'Accept all', 'Reject all', 'Choose cookies'.
Prompts to generate variations
If you use an AI UI generator such as Inspo AI, these prompts are a good starting point for exploring variations of this pattern:
- Design a GDPR-friendly cookie banner with Accept all, Reject all and Choose, plus a preferences modal with categories.
- Create a compact corner cookie notice for a SaaS marketing site.
- Design a consent placeholder for an embedded video that loads only after consent.
Related patterns
Consent banners are a special case of toast notifications and modal dialogs, and their buttons should follow your general error and form guidelines.
Generate this pattern for your product
Inspo AI designs the full pattern with every state, grounded in how real products solve it, and exports React + Tailwind.
Sources and further reading
- WAI-ARIA Authoring Practices Guide · Accessible keyboard and screen reader patterns for UI components.
- WCAG 2.1: Non-text Contrast · Contrast requirements for buttons, borders and icons.
- WCAG 2.1: Use of Color · Why color should never be the only way information is shown.
- Nielsen Norman Group articles · Usability research on interface patterns.
More UI patterns
Questions people ask
Does a cookie banner need a reject button?
In the EU and UK, regulators expect rejecting to be as easy as accepting, so a clear 'Reject all' option is recommended.
Where should a cookie banner go?
Most sites place it at the bottom of the screen so it does not block the main content.
Can I use a cookie wall?
Blocking access until users accept is restricted in many jurisdictions. Check the rules where your users are.
Do I need a cookie banner?
If you use non-essential cookies, such as analytics or advertising, and have visitors from regions like the EU or UK, you generally need consent. Check the rules for your audience.
Can I use analytics without a cookie banner?
Some privacy-focused analytics tools work without cookies or personal data, which can remove the need for consent in some jurisdictions.

↘ Building Inspo AI | AI-Powered Design Research & Builder Platform | Design Engineer.