Thanks to visit codestin.com
Credit goes to www.openconsent.dev

Open Consent
shadcn/ui Registry Compatible

Cookie Consent
Done Right

A full-featured, GDPR-compliant cookie consent solution for React and Next.js. Install via shadcn/ui registry in seconds.

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

Everything you need

Built for developers who care about privacy compliance and user experience.

GDPR & CCPA Compliant

Granular consent categories with easy withdrawal and consent versioning.

Full Traceability

Complete audit trail with configurable API endpoint for compliance records.

Script Management

Automatic loading and unloading of third-party scripts based on consent.

shadcn/ui Compatible

Built with shadcn/ui primitives - Button, Dialog, Switch, Card, and more.

TypeScript First

Fully typed with exported types for a great developer experience.

Hybrid Consent Scope

Device-level for anonymous users, global sync for authenticated users.

Simple to integrate

Wrap your app with the provider, add the banner component, and you're done. No complex configuration needed.

  • One command installation via shadcn CLI
  • Uses your existing shadcn/ui components
  • Automatic localStorage persistence
  • TypeScript support out of the box
layout.tsx
import {
  CookieConsentProvider,
  CookieBanner,
} from "@/components/cookie-consent"

export default function App({ children }) {
  return (
    <CookieConsentProvider
      config={{
        consentVersion: "1.0.0",
        privacyPolicyUrl: "/privacy",
      }}
    >
      {children}
      <CookieBanner />
    </CookieConsentProvider>
  )
}

Built on shadcn/ui

Uses the components you already have. No additional dependencies required.

buttondialogswitchcardlabelaccordion

Ready to add cookie consent to your app?

Get started in seconds with the shadcn CLI. Full documentation available.