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
- Launch above a hero
- Changelog teaser
- Release note
- Beta invite
- Docs home
Examples
From a changelog entry
Click only
Installation
npx knowns-ui@latest add announcement-pillPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Announcement pill from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/announcement-pill
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add announcement-pill
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/code-block/code-block.tsx
- components/ui/knowns/code-block/code-block-utils.ts
- components/ui/knowns/blocks/content/prose.tsx
- components/ui/knowns/blocks/content/content-utils.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/toggle-group.tsx
- components/ui/knowns/blocks/content/changelog-feed.tsx
- components/ui/knowns/blocks/site/announcement-pill.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/announcement-pill, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "announcement-pill" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.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- Default
false - The card kept open. A hover or focus preview is not reported.
- preview
boolean- Default
true - Show the card on hover and keyboard focus. Off: click or Enter only.
- hoverDelay
number- Default
200 - Pause before a hover preview, in ms, so a pointer passing over does not open it.
- width
number- Default
360 - 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| text | ReactNode | - | The pill's line, e.g. Run replays are here. Keep it under about 40 characters. |
| label | string | "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" | "center" | Where the card grows from: the pill's centre (a centred hero) or its left edge. |
| open / defaultOpen / onOpenChange | boolean / (open) => void | false | The card kept open. A hover or focus preview is not reported. |
| preview | boolean | true | Show the card on hover and keyboard focus. Off: click or Enter only. |
| hoverDelay | number | 200 | Pause before a hover preview, in ms, so a pointer passing over does not open it. |
| width | number | 360 | 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
- 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.
- 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.
- 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.
- 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.
- 05Takes a changelog-feed entry as it is, through fromChangelogEntry.
- 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
| State | What moves | Timing |
|---|---|---|
| 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
- A notice for every page, above the header: use Announcement Bar.
- The full list of releases: use Changelog Feed.
- A message about one action, like Saved: use Toast.
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" }).