Skip to content
Haze UI

Announcement pill

A small pill link with an optional leading tag and a trailing arrow, set above a hero headline to point at a release or news item.

pnpm dlx shadcn@latest add @haze/announcement-pill
Open preview in a new tab
Liveno JavaScript

When to use

  • A hero headline needs one short pointer to a release, changelog entry or launch post above it.
  • A feature or beta label should sit next to a one-line teaser that links onward.
  • The pointer should stay inline with the page, not span the full width.

When not to use

  • The message is a site-wide or dismissible notice across the top of the page; use banner.
  • The label is only a status or count with no destination; use badge or tag.
  • The action is the main call to action of the page; use button.

Installation

Add the Haze registry to components.json once, then install Announcement pill with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/announcement-pill
First 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

PropTypeDefaultDescription
hrefstring"#changelog"Destination of the whole pill. Always rendered as a real link.
textstring"Ledgerline 4.2 adds bank rules"Announcement text. It wraps onto a second line on narrow screens.
tagstring"New"Short leading tag. Pass an empty string to hide it.
variant"default" | "brand""default"Neutral pill or an emphasised muted pill with a solid tag.
arrowbooleantrueShows the trailing arrow, which nudges 2 px right on hover.
classstring–Extra classes, merged with tailwind-merge.
...attributesHTML anchor attributes–Passed to the <a>: target, rel, aria-label and so on.

Keyboard interactions

Enter
Follow the link

Accessibility

  • The whole pill is one anchor, so the tag, text and arrow read as a single link name such as "New Ledgerline 4.2 adds bank rules".
  • The arrow is decorative and hidden from assistive technology; the tag text is part of the link name, so keep it meaningful.
  • The pill is at least 28 px tall and has a visible focus ring. The muted fill keeps 4.5:1 text contrast.
  • The arrow nudge and the press scale are switched off under prefers-reduced-motion.

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 component "Announcement pill" with `npx shadcn@latest add @haze/announcement-pill`. 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 AnnouncementPill from "@/components/haze/ui/announcement-pill.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/ui/announcement-pill.md

  • Customize with real content

    Adapt the Haze announcement-pill ui for our product. Replace the demo values of these props with our real content: href, text, tag, variant, arrow, class, ...attributes. Keep the layout, the heading level rules and these accessibility details: The whole pill is one anchor, so the tag, text and arrow read as a single link name such as "New Ledgerline 4.2 adds bank rules". The arrow is decorative and hidden from assistive technology; the tag text is part of the link name, so keep it meaningful. The pill is at least 28 px tall and has a visible focus ring. The muted fill keeps 4.5:1 text contrast. The arrow nudge and the press scale are switched off under prefers-reduced-motion. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using announcement-pill, check it fits: use it when a hero headline needs one short pointer to a release, changelog entry or launch post above it.; a feature or beta label should sit next to a one-line teaser that links onward.; the pointer should stay inline with the page, not span the full width.. Avoid it when the message is a site-wide or dismissible notice across the top of the page; use banner.; the label is only a status or count with no destination; use badge or tag.; the action is the main call to action of the page; use button.. Alternatives: @haze/banner, @haze/badge, @haze/tag, @haze/button.

Dependencies

  • npm: @lucide/astro
  • @haze/tag
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog