Cnippet

Banner

Component

About

A dismissible, color-coded bar for site-wide or page-wide messages like promotions, maintenance notices, or trial reminders.

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

Code

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

Usage.tsx

import { Megaphone } from "lucide-react";
import {
  Banner,
  BannerAction,
  BannerClose,
  BannerContent,
  BannerDescription,
  BannerTitle,
} from "@/components/ui/banner";
import { Button } from "@/components/ui/button";

export default function BannerDemo() {
  return (
    <Banner variant="primary">
      <Megaphone />
      <BannerContent>
        <BannerTitle>Launch week: 30% off annual plans</BannerTitle>
        <BannerDescription>Ends Friday, Oct 23.</BannerDescription>
      </BannerContent>
      <BannerAction>
        <Button size="sm" variant="secondary">
          Upgrade
        </Button>
        <BannerClose />
      </BannerAction>
    </Banner>
  );
}

Dependencies

More by Cnippet

View all
  • Team

    Team

    1.4K
  • Davincho Hero-1

    Davincho Hero-1

    721
  • Aero Hero-3

    Aero Hero-3

    638
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    602
  • Features

    Features

    542
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    497
  • Text Reveal

    Text Reveal

    408
  • Blogs

    Blogs

    407