Command Palette

Search for a command to run...

Docs
Banner Cookie

Banner Cookie

A cookie consent banner with accept, decline, and preferences options.

Installation

Usage

import BannerCookie from "@/components/ruixen/banner-cookie";
 
export default function MyCookieBanner() {
  return (
    <BannerCookie
      position="bottom"
      onAccept={() => console.log("Cookies accepted")}
      onDecline={() => console.log("Cookies declined")}
      onSettings={() => console.log("Open preferences")}
    />
  );
}

Props

PropTypeDefaultDescription
titlestring"We value your privacy"The banner title
descriptionstring-The privacy message
acceptLabelstring"Accept all"Accept button text
declineLabelstring"Decline"Decline button text
settingsLabelstring"Preferences"Settings button text
position"bottom" | "top" | "bottom-left" | "bottom-right""bottom"Banner position
showSettingsbooleantrueShow preferences button
onAccept() => void-Callback when accepted
onDecline() => void-Callback when declined
onSettings() => void-Callback when settings clicked
classNamestring-Additional CSS classes

Positions

PositionDescription
bottomFixed to bottom edge, full width
topFixed to top edge, full width
bottom-leftFloating card at bottom left corner
bottom-rightFloating card at bottom right corner