DEV Community

Cover image for GDPR Cookie Consent Banner With JS Examples & API
jQueryScript
jQueryScript

Posted on

GDPR Cookie Consent Banner With JS Examples & API

Neiki's Cookie Banner: a vanilla JavaScript library that adds a GDPR-compliant cookie consent banner to any site with a single script tag.

Key features:

  • Bar, box, and modal layouts with light/dark/auto themes
  • Granular per-category consent with toggle controls
  • Google Consent Mode v2 integration built in
  • Script blocking via data attributes for third-party scripts
  • Versioned consent records for re-prompt on policy changes
  • Zero dependencies, MIT licensed

👉 Blog Post

👉 GitHub Repo

👉 Live Demo

Top comments (0)