# Banner 2

> Banner

A shadcn/ui block from the [@cnippet-blocks](https://blocks.cnippet.dev/?utm_source=shadcn.exchange) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet-blocks/banner-2).

- Page, with a live preview: https://shadcn.exchange/r/cnippet-blocks/banner-2
- Screenshot: https://shadcn.exchange/shot/cnippet-blocks/banner-2/light.png
- Registry item: https://blocks.cnippet.dev/r/banner-2.json
- Categories: banner
- Listed: 2026-11-01, source last changed 2026-11-01

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/cnippet-blocks/banner-2.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `lucide-react`
- Registry items: `@cnippet/button`

## Files

### `registry/default/sections/banner-2.tsx`

```tsx
"use client";

import { Sparkles, X } from "lucide-react";
import Link from "next/link";
import { useState } from "react";
import { Button } from "@/components/ui/button";

export default function Banner02() {
  const [isClosed, setIsClosed] = useState(false);

  if (isClosed) return null;

  return (
    <div className="w-full py-4 md:py-10">
      <div className="flex w-full flex-col items-start gap-3 bg-gray-100 px-4 py-3 sm:flex-row sm:items-center sm:gap-2 sm:px-6 sm:py-2 dark:bg-violet-800">
        <Sparkles className="h-5 w-5 shrink-0 text-gray-700 dark:text-white" />

        <div className="min-w-0 flex-1">
          <p className="text-gray-900 text-sm dark:text-white">
            <span className="font-semibold">
              We&apos;ve just announced our Series A1.
            </span>{" "}
            <Link
              className="text-gray-600 underline hover:text-gray-900 dark:text-gray-100 dark:hover:text-white"
              href="#"
            >
              Read about it from our CEO.
            </Link>
          </p>
        </div>

        <div className="flex w-full items-center gap-2 sm:w-auto">
          <Button className="rounded-full text-xs" size="sm">
            Read update
          </Button>

          <Button
            className="border-none text-gray-700 shadow-none hover:bg-transparent dark:text-white"
            onClick={() => setIsClosed(true)}
            variant="ghost"
          >
            <X className="h-4 w-4" />
          </Button>
        </div>
      </div>
    </div>
  );
}
```
