@whotechs/react-gdpr-cookie-banner
Version:
A modern, customizable GDPR & Google Consent Mode v2 compliant cookie consent banner
37 lines (36 loc) • 1.19 kB
TypeScript
import React from 'react';
declare global {
interface Window {
dataLayer: any[];
gtag: (...args: any[]) => void;
}
}
export interface CookiePreferences {
essential: boolean;
analytics_storage: boolean;
ad_storage: boolean;
ad_user_data: boolean;
ad_personalization: boolean;
}
export interface CookieBannerProps {
/** Primary color used for buttons and switches */
primaryColor?: string;
/** Text color for the banner */
textColor?: string;
/** Background color for the banner */
backgroundColor?: string;
/** Custom CSS class for the banner container */
className?: string;
/** Callback function when preferences are updated */
onPreferencesUpdate?: (preferences: CookiePreferences) => void;
/** Custom text for the title */
titleText?: string;
/** Custom text for the description */
descriptionText?: string;
/** Wait time in milliseconds before showing the banner */
showDelay?: number;
/** Google Tag Manager container ID */
gtmContainerId?: string;
}
declare const CookieBanner: React.FC<CookieBannerProps>;
export default CookieBanner;