ConsentBanner
A privacy/cookie consent banner with balanced Accept / Reject / Manage actions.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
A privacy/cookie consent banner with balanced Accept / Reject / Manage actions.
Accessibility
Masked values stay obscured to assistive tech until revealed; the reveal toggle is a labelled button. Audit entries are an ordered list.
Install and import
npx shadcn@latest add @prism/consent-banner
import { ConsentBanner } from '@/components/prism/ConsentBanner';
In a no-build prototype, read it from the bundle instead: const { ConsentBanner } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
title | React.ReactNode | — | |
description | React.ReactNode | — | |
acceptLabel | React.ReactNode | — | |
rejectLabel | React.ReactNode | — | |
manageLabel | React.ReactNode | — | |
onAcceptAll | () => void | — | Accept all optional cookies. |
onReject | () => void | — | Reject non-essential cookies. |
onManage | () => void | — | Open granular preferences. When omitted, the Manage button is hidden. |
policyHref | string | — | Link to the full privacy policy. |
policyLabel | React.ReactNode | — | |
position | "inline" | "fixed" | — | "inline" (in flow) or "fixed" (pinned to the bottom of the viewport). |
icon | React.ReactNode | — | Override the leading icon (SVG path nodes). |
className | string | — |