<ConsentBanner /> props
All props are optional — defaults are in English, override everything to localize.
| Prop | Default | Description |
|---|---|---|
title |
"We value your privacy" |
Banner heading. Pass "" to omit it. |
message |
"We use cookies to enhance your experience. You can accept or decline them." |
Banner body text. |
acceptLabel |
"Accept" (or "Accept all" with categories) |
Accept button label. |
declineLabel |
"Decline" (or "Decline all" with categories) |
Decline button label. |
saveLabel |
"Save preferences" |
“Save” button label, only shown when categories is set. |
privacyHref |
(none) | If set, renders a link to your privacy policy. |
privacyLabel |
"privacy policy" |
Link text for privacyHref. |
showReopenButton |
true |
Show a small persistent button to revisit the choice. |
reopenLabel |
"Cookie settings" |
Reopen button label. |
reopenAriaLabel |
"Change cookie preferences" |
Reopen button aria-label. |
categories |
(none) | { id, label, description?, default? }[] — enables per-category consent. |
expiryDays |
365 |
Days a stored choice stays valid before the banner reappears. |
ConsentCategory
Section titled “ConsentCategory”The shape of each entry in categories:
interface ConsentCategory { /** Storage key for this category — must be stable across deploys. */ id: string; /** Toggle label. */ label: string; /** Optional helper text shown under the label. */ description?: string; /** Pre-checks this category. Leave false for genuine opt-in consent. */ default?: boolean;}See Per-category consent for a full example.