# OpenConsent

> GDPR-compliant cookie consent for React and Next.js with Google Consent Mode v2 built in, installed through the shadcn/ui registry.

- Website: https://openconsent.dev
- Source: https://github.com/yhauxell/open-cookie-consent-banner
- Case study: https://yausell.com/work/openconsent
- Stack: Next.js, React, TypeScript, shadcn/ui, Supabase
- License: MIT

## What it is

GDPR-compliant cookie consent for React and Next.js, free and open source under the MIT license. It ships as source through the shadcn/ui registry rather than as a package, so a team owns the code it installs:

```
npx shadcn@latest add https://openconsent.dev/r/cookie-consent.json
```

## Who it's for

Teams running React or Next.js sites with EU, EEA or UK traffic, where Google Consent Mode v2 has been required since March 2024.

## What ships

- Google Consent Mode v2 built in, plus GDPR and CCPA compliance with granular categories, easy withdrawal and consent versioning.
- Third-party scripts that load and unload automatically as consent changes.
- An audit trail through a configurable API endpoint, and consent persisted in localStorage.
- A banner, settings dialog and trigger built from shadcn/ui primitives, fully typed in TypeScript.

## How it's built

Next.js and React with Tailwind CSS and Radix-based shadcn/ui components; the banner animates with Framer Motion. Behaviour is covered by Vitest and Testing Library suites for the banner, the provider, the trigger, script detection and the Consent Mode integration.

## Receipts

- GitHub stars: 16 (GitHub, 2026-11-01, https://github.com/yhauxell/open-cookie-consent-banner)
- Last commit: 2026-09-16 (GitHub, 2026-11-01, https://github.com/yhauxell/open-cookie-consent-banner/commits)

## Sources

- [openconsent.dev](https://openconsent.dev)
- [GitHub repository](https://github.com/yhauxell/open-cookie-consent-banner)
