Arunachalam

Cookie Banner

Buttons 26

About

CookieBanner is a lightweight, responsive cookie consent component for Next.js built with TypeScript and TailwindCSS v4. It displays a customizable message with Accept and Decline actions, remembers the user’s choice in localStorage, and supports light/dark themes. Smooth slide-and-fade animations are powered entirely by Tailwind’s tw-animate-css utilities, ensuring no extra animation libraries are needed. This banner is fully accessible, adapts its layout across screen sizes, and can appear at the top or bottom of the viewport based on your preference — making it easy to integrate into any modern web app.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Cookie Banner to your project and fits it to your theme.

Code

How Cookie Banner is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { CookieBanner } from "@/components/ui/cookie-banner";

export default function DemoPage() {
  return (
    <main className="flex min-h-screen items-center justify-center bg-background text-foreground p-8">
      <div className="text-center max-w-md">
        <h1 className="text-3xl font-bold mb-4">Cookie Banner Demo</h1>
        
        <p className="mb-6 text-muted-foreground">
          This is a demo page showing how the cookie banner works.
        </p>

        <CookieBanner />
      </div>
    </main>
  );
}

More by Arunachalam

View all
  • Scroll media expansion hero

    Scroll media expansion hero

    10.6K
  • Profile Card Testimonial Carousel

    Profile Card Testimonial Carousel

    1.2K
  • Modern Animated Sign In

    Modern Animated Sign In

    1.1K
  • Bottom Nav Bar

    Bottom Nav Bar

    800
  • Toast

    Toast

    659
  • Adaptive Notch Navigation Bar

    Adaptive Notch Navigation Bar

    652
  • Connected Carousel

    Connected Carousel

    376
  • Animated File Tree

    Animated File Tree

    336

More in Buttons

View all
  • Button

    Button

    5
  • Texture Button

    Texture Button

    92
  • App Store Button

    App Store Button

    453
  • Button

    Button

    47
  • Eclipse Button

    Eclipse Button

    39
  • Split Button

    Split Button

    14
  • Button

    Button

    4
  • Button

    Button

    32