Components
CookieConsent
A GDPR-compliant cookie consent banner or popup.
Overview
CookieConsent renders a dismissable banner prompting users to accept or configure cookie preferences. Supports granular category toggles and remembers user choice via localStorage.
Usage
<CookieConsent
onAcceptAll={handleAcceptAll}
onReject={handleReject}
onCustomize={handleCustomize}
/>API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
onAcceptAll | () => void | — | Accept all cookies handler |
onReject | () => void | — | Reject optional cookies handler |
onCustomize | (prefs: CookiePreferences) => void | — | Custom preferences handler |
position | 'bottom' | 'top' | 'bottom' | Banner position |
storageKey | string | 'ds0-cookie-consent' | localStorage key |
Related Components
| Component | When to Use Instead |
|---|---|
| Banner | Generic announcement bar |
| Dialog | Complex consent modal |