Banner: release notice
A compact release announcement with an optional link to the details.
pnpm dlx shadcn@latest add @haze/banner-release-notice---
import { ArrowRight, Sparkles } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";
interface Props {
id?: string;
label?: string;
title?: string;
description?: string;
href?: string;
linkLabel?: string;
headingLevel?: 1 | 2 | 3;
class?: string;
}
const {
id = "banner-release-notice",
label = "What's new",
title = "A more focused workspace is here",
description = "Explore the latest improvements to your shared projects.",
href,
linkLabel = "See what's changed",
headingLevel = 2,
class: className,
} = Astro.props;
const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel];
---
<section aria-labelledby={`${id}-title`} class={cn("bg-background px-6 py-8", className)}>
<div class="mx-auto flex max-w-6xl flex-col gap-4 rounded-xl border border-border bg-card p-5 sm:flex-row sm:items-center sm:gap-5 sm:px-6">
<span class="flex size-10 shrink-0 items-center justify-center rounded-lg bg-foreground/5 text-foreground inset-ring inset-ring-frame"><Sparkles aria-hidden="true" class="size-5" /></span>
<div class="min-w-0 flex-1">
<p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">{label}</p>
<Heading id={`${id}-title`} class="mt-1 text-sm/5 font-semibold text-foreground">{title}</Heading>
<p class="mt-1 text-sm/6 text-muted-foreground">{description}</p>
</div>
{href && <a href={href} class="inline-flex min-h-10 shrink-0 items-center gap-2 self-start rounded-md text-sm/5 font-medium text-foreground transition-colors duration-150 ease-snappy hover:text-foreground/80 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring sm:self-center">{linkLabel}<ArrowRight aria-hidden="true" class="size-4" /></a>}
</div>
</section>When to use
- Calling attention to a product update within a page
- The notice needs a title, brief explanation and optional destination
When not to use
- The content is a complete call to action with several choices; use cta-banner
Installation
Add the Haze registry to components.json once, then install Banner: release notice with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.
pnpm dlx shadcn@latest add @haze/banner-release-noticenpx shadcn@latest add @haze/banner-release-noticeyarn dlx shadcn@latest add @haze/banner-release-noticebunx --bun shadcn@latest add @haze/banner-release-noticeFirst time? Registry and theme setup
1. Add to components.json:
{
"registries": {
"@haze": "http://localhost:4329/r/{name}.json"
}
}2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | "banner-release-notice" | Unique notice ID prefix. |
| label | string | "What's new" | Short label above the notice title. |
| title | string | demo heading | Notice heading. |
| description | string | demo copy | Short supporting explanation. |
| href | string | – | Optional destination for details; no link is rendered without it. |
| linkLabel | string | "See what's changed" | Text for the details link. |
| headingLevel | 1 | 2 | 3 | 2 | Heading level for the page context. |
| class | string | – | Additional section classes. |
Keyboard interactions
- Tab, Enter
- Follow the release link when a destination is provided.
Accessibility
- The notice is labelled by its heading and makes no claim to be a live alert.
- The link is omitted entirely when no destination is supplied.
Notes for AI
Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.
Install and use
Install the Haze UI block "Banner: release notice" with `npx shadcn@latest add @haze/banner-release-notice`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import BannerReleaseNotice from "@/components/haze/blocks/banner-release-notice.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/blocks/banner-release-notice.md
Customize with real content
Adapt the Haze banner-release-notice block for our product. Replace the demo values of these props with our real content: id, label, title, description, href, linkLabel, headingLevel, class. Keep the layout, the heading level rules and these accessibility details: The notice is labelled by its heading and makes no claim to be a live alert. The link is omitted entirely when no destination is supplied. Do not add raw color classes; use the Haze tokens.
Choose the right block
Before using banner-release-notice, check it fits: use it when calling attention to a product update within a page; the notice needs a title, brief explanation and optional destination. Avoid it when the content is a complete call to action with several choices; use cta-banner. Alternatives: @haze/cta-banner, @haze/changelog-release-list.
Dependencies
- npm: @lucide/astro
- @haze/utils
- @haze/theme (one-time setup)
Source · Original Haze UI work.