Cookie consent

Core

A consent bar that morphs into preferences and folds into a reopen button.

pnpm dlx shadcn@latest add https://wui.alann.works/r/cookie-consent.json

API Reference

PropTypeDefault
categoriesCookieCategory[]—
valueCookieConsentValue | null—
defaultValueCookieConsentValue | null—
onChange(value: CookieConsentValue | null, detail: { action: CookieConsentAction; updatedAt: Date }) => void—
storageKeystring—
versionstring—
preferencesOpenboolean—
defaultPreferencesOpenboolean—
onPreferencesOpenChange(open: boolean) => void—
policy{ label: string; href?: string; onClick?: () => void }—
position"bottom" | "bottom-left" | "bottom-right"—
strategy"fixed" | "absolute"—
showReopenButtonboolean—
reopenSide"left" | "right"—
labelsPartial<CookieConsentLabels>—
classNamestring—
Categories
feedback
Dependencies
@radix-ui/react-switchlucide-reactmotion