Cookie Consent
A floating glass consent card with equal-weight Accept / Reject (no dark patterns) and a Customise drawer of per-category switches that expands in place, plus a chip to reopen settings.
Try it: Try Customise, flip a switch, Save; reopen with the chip.
Installation
Install with the shadcn CLI:
npx shadcn@latest add https://www.framekitui.live/r/cookie-consent.jsonOr, with the @framekit namespace registered: npx shadcn@latest add @framekit/cookie-consent. You can also copy the source into components/ui/cookie-consent.tsx (view on GitHub).
Usage
import { CookieConsent } from '@/components/ui/cookie-consent'Props
| Prop | Type | Default | Notes |
|---|---|---|---|
categories | ConsentCategory[] | necessary / analytics / marketing | { id, label, description, required?, defaultOn? } |
open / defaultOpen | boolean | true | Controlled or uncontrolled. |
onDecision | (choice) => void | — | Receives { [id]: boolean }. |
showReopen | boolean | true | Show the settings chip after deciding. |
Dependencies
motionlucide-react
Related Website Sections components
- Announcement Bar
A slim ink top bar with a sweeping sheen; messages roll vertically with a blur, dots pick one, hover or focus pauses, and dismissing collapses the height smoothly.
- Site Footer
A calm SaaS footer: link columns with sliding hairline underlines, a live status pill, socials, a language picker and a giant outlined wordmark that rises from the bottom edge.
- Changelog Timeline
Release notes on a timeline with sticky dates, popping dots, generated cover art and a filter (All / New / Improved / Fixed) that re-flows each change list on springs.
- Newsletter Signup
An inline email capture with inline validation, a button that morphs to a spinner, a shake on error, a polite live region and a success state with undo.
- Glass App Dock
A macOS-style dock: icons magnify on a spring with a cosine falloff around the pointer, labels float above, launching bounces the icon and lights a running dot. Keyboard focus magnifies too.
- CTA Glow Banner
A closing call-to-action on an ink panel: a soft lilac and orange aurora trails the pointer behind a fine dot grid, the block rises in on scroll and the arrow nudges on hover.