---
title: Banner Blocks for Astro
description: "Astro announcement strips for short messages and a related destination."
seo:
    title: "Astro Banner blocks: examples and source"
sidebar:
    label: "Banner"
related:
    - /blocks
    - /components
    - /docs/astro-business-websites
---

## Inline announcement

Keep a short announcement and its destination together.

```astro
---
import Banner1Block from "@/components/blocks/banner/banner-1.astro"
---

<Banner1Block
  title="The autumn reading list is ready"
  description="Read practical notes on planning a week, keeping a journal, and making time for a review."
  link={{
    label: "Read the reading list",
    href: "https://example.com/morrow/reading-list",
  }}
/>
```

```sh
bunx --bun shadcn@latest add @gnostic/banner-1
```

## Floating actions

Give an inset announcement room for two action links.

```astro
---
import Banner2Block from "@/components/blocks/banner/banner-2.astro"
---

<Banner2Block
  title="Studio appointments open for October"
  description="Choose a repair assessment and tell us what you want to bring to the studio."
  buttons={[
    {
      label: "Book an assessment",
      href: "https://example.com/morrow/appointments",
    },
    {
      label: "Read visit details",
      href: "https://example.com/morrow/visit",
      variant: "outline",
    },
  ]}
/>
```

```sh
bunx --bun 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](/components/alert) for a message tied to one page region and [Header](/blocks/header) for primary navigation.
