Skip to content

Announcement Pill

The New line above a hero headline, with the story one hover away. The pill grows in place into a small changelog card with a title, two lines, an image or a short list and a link, and shrinks back when you leave. Click or Enter keeps it open, Esc closes it, and nothing on the page moves.

On this page
Used for
  • Launch above a hero
  • Changelog teaser
  • Release note
  • Beta invite
  • Docs home

Examples

Card
Grows from

From a changelog entry

Click only

Installation

npx knowns-ui@latest add announcement-pill
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

text
ReactNode
The pill's line, e.g. Run replays are here. Keep it under about 40 characters.
label
string
Default"New"
The word in the accent at the start of the pill, such as New, Beta or a version.
card
{ title?, date?, description?, media?, items?, link? }
What the card shows. description is cut at two lines, items at three. fromChangelogEntry(entry) builds it.
align
"center" | "start"
Default"center"
Where the card grows from: the pill's centre (a centred hero) or its left edge.
open / defaultOpen / onOpenChange
boolean / (open) => void
Defaultfalse
The card kept open. A hover or focus preview is not reported.
preview
boolean
Defaulttrue
Show the card on hover and keyboard focus. Off: click or Enter only.
hoverDelay
number
Default200
Pause before a hover preview, in ms, so a pointer passing over does not open it.
width
number
Default360
Card width in px. It never gets wider than the screen less 48px.
fromChangelogEntry
(entry, linkLabel?) => card
Title, summary, date, media and the first link (or the entry's own page) of a changelog-feed entry.

What it handles

  1. 01Puts a New pill above a headline that grows in place into a small card: a date, a title, two lines, an image or three points and a link.
  2. 02Keeps the pill where it is as the card's top row, so it reads as one surface growing; the hero under it never moves.
  3. 03Shows a preview on hover after a short pause, or when the pill gets keyboard focus, and drops it when the pointer or focus leaves.
  4. 04Keeps the card open on click or Enter, with a close button; Esc and a click outside close it and focus goes back to the pill.
  5. 05Takes a changelog-feed entry as it is, through fromChangelogEntry.
  6. 06Fits a phone: the card is never wider than the screen less 48px.

States

First render
Nothing. A card that starts open paints open
none
Open
The card's surface fades in and its body folds open down from the pill
180ms fold, 120ms fade, ease out
Close
The card fades out
120ms, ease out
Chevron
Turns a quarter while the card is shown
180ms, ease out
Hover on the pill
The fill darkens a step
120ms, ease out
Reduced motion
The card appears and goes at once
0ms

Works with

When to use

When to use

  • A launch or a new feature above a hero headline, with a short card that explains it without leaving the page.
  • A teaser that links a landing page to the matching changelog entry.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Announcement Pill to my app and wire it to my own data.
  • I need a launch or a new feature above a hero headline, with a short card that explains it without leaving the page. Set that up with the Knowns UI Announcement Pill.
  • Which Announcement Pill props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "announcement-pill" }) and search_docs({ query: "announcement pill" }).

Need help?

Stuck on Announcement Pill, or found something off? We read every message.