Cookie Banner

Floating React cookie consent card fixed to the corner, with a short notice and Accept and Reject buttons. It is a labelled dialog for assistive tech.

src/registry/ui/cookie-banner.tsx/r/cookie-banner.json

Installation#

bash
npx shadcn@latest add @minidev/cookie-banner

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/cookie-banner.json

Usage#

tsx
import { CookieBanner } from "@/components/ui/cookie-banner"

export function Example() {
  return <CookieBanner />
}

API reference#

CookieBanner props
PropTypeDefault
onAccept() => void-
onReject() => void-
classNamestring-

Dependencies#

npm

React only

Built from

All Landing page sections for React and Tailwind

Learn more