Skip to main content

ConsentBanner

A privacy/cookie consent banner with balanced Accept / Reject / Manage actions.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When 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​

PropTypeRequiredDescription
titleReact.ReactNode—
descriptionReact.ReactNode—
acceptLabelReact.ReactNode—
rejectLabelReact.ReactNode—
manageLabelReact.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.
policyHrefstring—Link to the full privacy policy.
policyLabelReact.ReactNode—
position"inline" | "fixed"—"inline" (in flow) or "fixed" (pinned to the bottom of the viewport).
iconReact.ReactNode—Override the leading icon (SVG path nodes).
classNamestring—