Patterns
CookieBanner
GDPR-style cookie consent banner with Accept/Decline and dismiss state.
Quick Preview
๐ช
We use cookies
We use cookies to enhance your browsing experience, analyze site traffic, and personalize content.
Installation
# No extra dependencies
// Copy component fromsrc/components/patterns/CookieBanner.tsx
Usage
import CookieBanner from '@/components/patterns/CookieBanner'// Renders as a sticky bottom banner until the user accepts or declines<CookieBanneronAccept={() => enableAnalytics()}onDecline={() => console.log('Declined')}/>
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | - | Banner title |
description | string | - | Banner description text |
onAccept | () => void | - | Accept callback |
onDecline | () => void | - | Decline callback |
position | 'bottom' | 'top' | 'bottom' | Banner position |
className | string | - | Additional CSS classes |