Componentfeedback0.83 KB gzipZero dependencies

Cookie Banner

Fixed privacy consent banner with accept and decline actions.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add cookie-banner

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { CookieBanner } from "@/components/ui/cookie-banner"; <CookieBanner onAccept={() => console.log("Admitted")} />

Source code

cookie-banner.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxcookie-banner.tsx75 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface CookieBannerProps extends React.HTMLAttributes<HTMLDivElement> {  title?: string;  description?: string;  onAccept?: () => void;  onDecline?: () => void;  className?: string;} export function CookieBanner({  title = "PRIVACY & ADMISSION COOKIES",  description = "We use minimal session cookies to remember your ticket stub and theme preferences.",  onAccept,  onDecline,

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { CookieBanner } from "@/components/ui/cookie-banner"; <CookieBanner />
PropTypeDescription
titlestringPrimary heading or title text. (Default: "PRIVACY & ADMISSION COOKIES")
descriptionstringDescriptive helper or subtitle text.
onAccept() => voidCallback invoked on accept.
onDecline() => voidCallback invoked on decline.
classNamestringOptional Tailwind or custom CSS classes merged with component styles.