X Enterprises
nuxt-x-marketing

PrivacyCookieBanner

Full-width bottom cookie consent banner with Accept, Reject, and Customize actions, persisted to localStorage.

PrivacyCookieBanner

A slide-up banner fixed to the bottom of the viewport. Persists the user's decision in localStorage under storageKey — the banner will not reappear once accepted or rejected. Emits accept, reject, and customize events.

Components

<XMarkPrivacyCookieBanner />

<XMarkPrivacyCookieBanner
  title="We use cookies"
  message="We use cookies to improve your experience. By continuing, you agree to our"
  policy-link="/privacy"
  policy-label="Privacy Policy"
  :has-customize="true"
  :has-reject="true"
  storage-key="cookie-consent-v1"
  @accept="trackConsent('accepted')"
  @reject="trackConsent('rejected')"
  @customize="openGdprModal"
/>

Props

PropTypeDefaultDescription
titlestring'We use cookies'Banner heading.
messagestringDefault cookie messageMain message text.
policyLinkstring'/privacy'Link URL for policy reference.
policyLabelstring'Learn more'Policy link label.
hasCustomizebooleanfalseShow "Customize" button.
hasRejectbooleantrueShow "Reject All" button.
storageKeystring'cookie-consent'localStorage key for persistence. The user's selection is stored as the string 'accepted' or 'rejected'.

Emits

EventDescription
acceptUser clicked Accept All.
rejectUser clicked Reject All.
customizeUser clicked Customize. Pair with XMarkPrivacyGDPR for granular control.

AI Context

category: Privacy
package: "@xenterprises/nuxt-x-marketing"
components:
  - XMarkPrivacyCookieBanner
use-when: >
  Implementing a prominent cookie consent banner fixed to the bottom of the
  viewport. Supports Accept, Reject, and Customize actions. Pair with
  XMarkPrivacyGDPR when granular category control is needed.
typical-page-section: Place in app.vue or a layout file so it appears on every page.
Copyright © 2026