Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Banner Blocks for Astro

Astro announcement strips for short messages and a related destination.

Inline announcement

Keep a short announcement and its destination together.

bunx --bun shadcn@latest add @gnostic/banner-1
npx shadcn@latest add @gnostic/banner-1
pnpm dlx shadcn@latest add @gnostic/banner-1

Floating actions

Give an inset announcement room for two action links.

bunx --bun shadcn@latest add @gnostic/banner-2
npx shadcn@latest add @gnostic/banner-2
pnpm dlx shadcn@latest add @gnostic/banner-2

Choose a banner layout

Choose a banner for a temporary service message or an announcement that belongs across several pages. Keep it short enough that it does not dominate the header.

Pass content from Astro

Pass the title, description, and optional link accepted by the variant. Use the link for the page that explains the notice. If a variant supports dismissal, make sure important information remains available after it closes.

Responsive layout and images

Check the message and action together on a phone. Text should wrap without hiding the close control. These layouts are text-led; an image is rarely needed. Inspect contrast on the selected banner surface in both modes.

Compose the next section

Use Alert for a message tied to one page region and Header for primary navigation.