Home / Blocks / Marketing / Banners
5 blocks in this section

Shadcn Announcement Banners

Announcement, promo, consent, floating-release and severity-alert banners, with persisted dismissal and a token-only colour system.

Jump to a banner block

5 blocks in this collection

Free Pro

  1. Banner 1 Free
  2. Banner 2 Pro
  3. Banner 3 Pro
  4. Banner 4 Pro
  5. Banner 5 Pro

How it works

Three steps to working code

Install a block and the files land in your repository. Nothing calls back to us.

  1. terminal

    $ npx shadcn@latest add @shadcnstore/banner-1

    ✓ Checking registry

    ✓ Installing dependencies

    01

    Run one command

    Every preview above prints its own. The CLI writes the block and the components it needs into your project.

    Installation docs
  2. your project 3 files added

    components/

    ├─ ui/

    ├─ button.tsx

    └─ navigation-menu.tsx

    └─ banner-1.tsx

    02

    Get real files

    React, TypeScript and Tailwind v4, with no framework imports. Next.js, Vite, Remix and Astro all work.

  3. banner-1.tsx

    <Menu.Trigger

    - asChild

    + render={<button />}

    />

    03

    Edit it as your own

    Built on Base UI, not Radix, so keyboard and focus behaviour come from the primitive.

Blocks that hold state already carry the use client directive the Next.js App Router needs.

Guide

A banner interrupts. That is its function and its risk, so the useful question is not how it looks but what happens the second time somebody sees it. These five cover the announcement, the promotion, consent and the in-product alert.

The five banner blocks#

  • Banner 1: a dismissible announcement bar that remembers the choice. Free.
  • Banner 2: a promo banner with a live countdown and a copyable discount code.
  • Banner 3: a cookie consent bar with a granular preferences dialog.
  • Banner 4: a delayed, scroll-gated floating announcement card with a spring entrance.
  • Banner 5: a token-only site alert system covering a sticky strip, page banners and inline banners.

Dismissal that sticks#

Banner 1 stores the dismissal, so closing it once keeps it closed on the next visit. A banner that reappears on every page load is the fastest way to train people to ignore every banner you will ever show, including the one that matters.

Banner 3 is a consent bar with a granular preferences dialog, so somebody can accept categories individually rather than choosing between all and nothing. It is the interface only. Which categories you offer, what you do before consent, and what the answer legally means are decisions for your site and your jurisdiction, not something a block can decide for you.

Promotions with a countdown#

Banner 2 pairs a countdown with a copyable code. Drive the end time from your campaign data so the timer cannot outlive the offer, and copy the code to the clipboard rather than asking somebody to select six characters on a phone.

Where a banner is the wrong tool#

A banner is for something time-bound that a visitor can act on now: an outage, a launch, an offer with an end date. It is not a place for a permanent value proposition, which belongs in the hero, or for a message aimed at one segment, which belongs wherever that segment already is. A banner that is always there stops being read within two visits, and takes the next one down with it.

One severity vocabulary#

Banner 5 shares its severity map with the notification blocks, so red means the same thing in a marketing banner and an in-product alert. A site with two unrelated ideas of what red means has, in effect, no colour vocabulary at all, and every warning after that gets read as decoration.

Where to place a banner#

Above the navbar for a site-wide announcement, so it pushes the page rather than covering it. The floating card in Banner 4 is scroll-gated and delayed on purpose: an interruption is more tolerable once somebody has shown interest than on arrival. For an offer that deserves the whole page, a call to action section carries it better than a strip.

FAQ

Banners questions, answered

What people ask before choosing a block from this collection.

Banner 1 stores the dismissal, so closing it once keeps it closed on the next visit rather than greeting the same person again. A banner that reappears on every page load is the fastest way to train people to ignore banners.
Banner 3 is a consent bar with a granular preferences dialog, so a visitor can accept categories individually instead of choosing between all and nothing. It is the interface only. Which categories you offer and what you do with the answer is a legal decision for your site, not something a block can decide.
Banner 2 pairs a live countdown with a copyable discount code, which is the usual promotion pattern. Set the end time from your own campaign data so the timer cannot outlive the offer.
Banner 5 is a token-only set covering a sticky strip, page banners and inline banners that share one severity map with the notification blocks. Using the same severity language in a marketing banner and an in-app alert is what stops a site having two unrelated ideas of what red means.
Banner 1, the dismissible announcement bar, is free. The countdown, consent, floating and alert-system variants are Pro under the pricing licence.

Documentation

The components behind these blocks

How to install, customise and combine the shadcn/ui components this collection is built from.

Free & Premium Templates

Launch Faster with Complete Templates

Love these blocks? Get our free dashboard and landing page templates with 30+ pre-built pages and all the components you need. Premium templates with advanced features launching soon at $69.

Free Templates Now
30+ Pages Included
Premium Coming Soon