
Cookie Preferences Dialog
Dialogs
Search by name, tag, category or type
Source and install need .
pnpm dlx shadcn@latest add @assembli/cookie-bannerA cookie consent banner where both answers weigh the same: Accept all and Reject all are identical buttons side by side. Customize opens the categories in place, each with a description, a switch (strictly necessary stays locked on) and its vendors under a disclosure, then Save choices. A corner card or a bottom bar that slides in with CSS. Also exports CookieSettingsButton to reopen it.
Other props pass through to the root element.
variant
"card" | "bar"
Default "card"
A card in the corner, or a bar across the bottom.
categories
CookieCategory[]
Default DEFAULT_COOKIE_CATEGORIES
open
boolean
defaultOpen
boolean
Default true
onOpenChange
(open: boolean) => void
value
CookieConsent | null
Default null
The visitor's saved choice, if they made one. When the banner reopens with a saved choice (from CookieSettingsButton, say), it starts on the categories with their switches as saved.
onConsent
(consent: CookieConsent, method: CookieConsentMethod) => void
Store this (a cookie or your consent platform) and stop showing the banner.
policyHref
string
title
React.ReactNode
Default "We value your privacy"
description
React.ReactNode
Default "We use cookies to keep the site working and, with your per…
strategy
"fixed" | "absolute"
Default "fixed"
fixed to the viewport, or absolute inside a positioned parent.
align
"start" | "end"
Default "start"
Which corner the card sits in.
| Description | |||
|---|---|---|---|
| variant | "card" | "bar" | "card" | A card in the corner, or a bar across the bottom. |
| categories | CookieCategory[] | DEFAULT_COOKIE_CATEGORIES | |
| open | boolean | – | |
| defaultOpen | boolean | true | |
| onOpenChange | (open: boolean) => void | – | |
| value | CookieConsent | null | null | The visitor's saved choice, if they made one. When the banner reopens with a saved choice (from |
| onConsent | (consent: CookieConsent, method: CookieConsentMethod) => void | – | Store this (a cookie or your consent platform) and stop showing the banner. |
| policyHref | string | – | |
| title | React.ReactNode | "We value your privacy" | |
| description | React.ReactNode | "We use cookies to keep the site working and, with your per… | |
| strategy | "fixed" | "absolute" | "fixed" |
|
| align | "start" | "end" | "start" | Which corner the card sits in. |

Dialogs

Notifications

Notifications

Notifications