Skip to content

CookieDialog Documentation

Lightweight, customizable cookie consent management for GDPR compliance

Why CookieDialog?

CookieDialog provides a simple, lightweight solution for GDPR cookie consent management that respects your users’ privacy while keeping your site compliant.

Zero Dependencies

Pure JavaScript implementation with no external dependencies. Less than 20KB gzipped.

Geolocation Detection

Automatically detect if users are in GDPR-required regions and show consent dialog accordingly.

Easy Integration

Simple CDN or NPM installation. Works with any framework or vanilla JavaScript.

Fully Customizable

Themes, translations, categories, and styling options to match your brand.

Quick Installation

CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/cookiedialog.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cookiedialog.min.js"></script>

NPM

Terminal window
npm install cookiedialog

Basic Usage

CookieDialog.init({
enableLocation: true,
privacyUrl: '/privacy',
onAccept: (consent) => {
console.log('Cookies accepted:', consent);
}
});

Live Demo

Features at a Glance

  • βœ… GDPR Compliant
  • βœ… Persistent consent storage
  • βœ… Cookie categories management
  • βœ… Mobile responsive
  • βœ… Dark/Light themes
  • βœ… Multiple languages support
  • βœ… TypeScript support
  • βœ… Accessibility compliant

Browser Support

  • Chrome/Edge 88+
  • Firefox 78+
  • Safari 14+
  • Opera 74+

Getting Help