| name | cookie-consent |
| description | Use when you need to inform users about the use of cookies. |
| metadata | {"id":"cookie-consent","category":"user-feedback","pattern":"Cookie Consent","source":"uxpatterns.dev","url":"https://uxpatterns.dev/patterns/user-feedback/cookie-consent","sourcePath":"apps/web/content/patterns/user-feedback/cookie-consent.mdx"} |
Cookie Consent
Inform users about the use of cookies
What it solves
A Cookie Consent pattern helps teams create a reliable way to explain optional tracking clearly, capture a meaningful choice, and let users revise that choice later. It is most useful when teams need websites using analytics or marketing cookies.
Compared with adjacent patterns, this pattern should reduce friction without hiding the state, rules, or recovery paths people need to keep moving.
When to use
- Websites using analytics or marketing cookies
- Regional consent requirements
- Privacy preference updates after the first visit
When to avoid
- Use a quieter state when the event is too minor to interrupt the task.
- Avoid transient feedback for events users must be able to revisit later.
- Do not duplicate the same message in several channels without a hierarchy rule.
Implementation workflow
- Confirm the pattern matches the problem and constraints before copying the example.
- Start from the anatomy and examples in
references/pattern.md, then choose the smallest viable variation.
- Apply accessibility, performance, and interaction guardrails before layering visual polish.
- Use the testing guidance to verify behavior across keyboard, screen reader, responsive, and failure scenarios.