# Cookie consent

> A cookie consent banner offering accept, reject, and preferences actions.

A shadcn/ui block from the [@quill](https://www.quilldesignsystem.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/quill/cookie-consent).

- Page, with a live preview: https://shadcn.exchange/r/quill/cookie-consent
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/quill/cookie-consent-light-39fd40277c0a437d.png
- Registry item: https://www.quilldesignsystem.com/r/cookie-consent.json
- Categories: feedback
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://www.quilldesignsystem.com/r/cookie-consent.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `button`, `https://www.quilldesignsystem.com/r/icon.json`

## Notes from the registry

A cookie consent banner offering accept, reject, and preferences actions. Do: "Reject non-essential" gets the same one-click ease as "Accept all" — both are top-level buttons, not one button plus a buried settings link. Don't: Make rejecting cookies harder to find or reach than accepting them — that's a dark pattern, not a real choice. Use announcement-banner when the message is informational only and doesn't require an explicit accept/reject decision. Use alerts when the message is a local, in-page status, not a site-wide compliance notice.

## Files

### `registry/blocks/cookie-consent.tsx`

```tsx
import { Button } from '@/components/ui/button'
import { Icon } from '@/components/ui/icon'

/** A cookie consent banner offering accept, reject, and preferences actions. */
export function CookieConsent() {
  return (
    <div className="flex w-[520px] items-start gap-3 rounded-xl bg-card p-4 text-foreground shadow-md ring-1 ring-foreground/10">
      <div className="flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground">
        <Icon name="info" size={18} />
      </div>
      <div className="flex flex-col gap-3">
        <p className="text-sm text-muted-foreground">
          We use essential cookies to make Quill work, and optional analytics to improve it. You can
          change your choice anytime.
        </p>
        <div className="flex flex-wrap gap-2">
          <Button size="sm">Accept all</Button>
          <Button size="sm" variant="outline">
            Reject non-essential
          </Button>
          <Button size="sm" variant="ghost">
            Preferences
          </Button>
        </div>
      </div>
    </div>
  )
}
```
