Uai

marketingannouncement-bar.tsx

Color theme

component · 60/108

Announcement Bar

A campaign message with actions, dismissal, and remembered dismissal.

Install

Install manuallyView source on GitHub

Anatomy

  • AnnouncementBar
  • AnnouncementBarLabel
  • AnnouncementBarMessage
  • AnnouncementBarActions
  • AnnouncementBarAction
  • AnnouncementBarDismiss

Accessibility3 checks

  • The bar is a region labelled by its message, so assistive technology can find and skip it.
  • Dismiss is a 28px button with an accessible name; dismissal does not move focus, and actions stay in normal tab order.
  • Pass storageKey to remember dismissal in localStorage, or control open with onOpenChange. Campaign scheduling stays consumer-owned.
canvasvariant="bar"marketing
Marketing and conversion
New

Shared workspaces are now included on every plan.

announcement bar variant

Code example

usage.tsx
"use client";import { useState } from "react";import {  AnnouncementBar,  AnnouncementBarAction,  AnnouncementBarActions,  AnnouncementBarDismiss,  AnnouncementBarLabel,  AnnouncementBarMessage,  type AnnouncementBarVariant,} from "@/components/ui/uai/announcement-bar";const STORAGE_KEY = "uai-preview-announcement-4-2";export function AnnouncementBarPreview({ variant = "bar" }: { variant?: AnnouncementBarVariant }) {  const [open, setOpen] = useState(true);  return (    <div style={{ display: "grid", gap: 12 }}>      <AnnouncementBar        variant={variant}        open={open}        onOpenChange={setOpen}        storageKey={STORAGE_KEY}      >        <AnnouncementBarLabel>New</AnnouncementBarLabel>        <AnnouncementBarMessage>          Shared workspaces are now included on every plan.        </AnnouncementBarMessage>        <AnnouncementBarActions>          <AnnouncementBarAction href="#release-notes" onClick={(event) => event.preventDefault()}>            Read release notes          </AnnouncementBarAction>          <AnnouncementBarDismiss />        </AnnouncementBarActions>      </AnnouncementBar>      {open ? null : (        <button          type="button"          onClick={() => {            window.localStorage.removeItem(STORAGE_KEY);            setOpen(true);          }}          style={{            justifySelf: "center",            height: 28,            padding: "0 12px",            border: 0,            borderRadius: 999,            background: "var(--uai-surface-raised)",            color: "var(--uai-text)",            fontSize: 12.5,            fontWeight: 500,            cursor: "pointer",          }}        >          Show the announcement again        </button>      )}    </div>  );}

Manual installation

announcement-bar.tsx

Loading component source…

esc
ThinkingAI
MessageAI
CitationAI
AttachmentAI
Tool CallAI
Response StatusAI
Run SummaryAI
Conversation ThreadAI · Block
Research SessionAI · Block
File AnalysisAI · Block
Agent RunAI · Block
Approval CardFeedback
Empty StateFeedback
Status BannerFeedback
Progress SummaryFeedback
Inline FeedbackFeedback
Confirmation DialogFeedback
Activity TimelineFeedback
Skeleton GroupFeedback
Prompt ComposerForms
Form FieldForms
Search FieldForms
Filter BarForms
File UploadForms
Date Range PickerForms
Form Error SummaryForms
Unsaved Changes BarForms
Step IndicatorForms
Task ListData Display
Data Table ToolbarData Display
Metric CardData Display
Description ListData Display
Comparison TableData Display
Kanban BoardData Display
Calendar ViewData Display
Audit LogData Display
App HeaderNavigation
App SidebarNavigation
Breadcrumb TrailNavigation
Page TabsNavigation
Command MenuNavigation
Split PaneNavigation
Sign-in CardAuthentication
Sign-up CardAuthentication
Password RecoveryAuthentication
Code VerificationAuthentication · Block
Onboarding WizardAuthentication · Block
Workspace SetupAuthentication · Block
Coupon FieldCommerce
Quantity PickerCommerce
Cart ItemCommerce
Price SummaryCommerce
Order StatusCommerce
Product DetailCommerce · Block
Product ListingCommerce · Block
Cart DrawerCommerce · Block
CheckoutCommerce · Block
Order TrackingCommerce · Block
Subscription ManagementCommerce · Block
Announcement BarMarketing
Pricing ToggleMarketing
Testimonial CardMarketing
Product GalleryMarketing
Trust PanelMarketing
Newsletter FormMarketing
Hero SectionMarketing · Block
Feature ShowcaseMarketing · Block
Pricing SectionMarketing · Block
Testimonials SectionMarketing · Block
FAQ SectionMarketing · Block
Call to ActionMarketing · Block
Waitlist SectionMarketing · Block
Contact SectionMarketing · Block
Author CardContent
CommentContent
Reaction BarContent
Share MenuContent
Changelog EntryContent
Article PageContent · Block
Documentation PageContent · Block
Changelog PageContent · Block
Comment ThreadContent · Block
Community FeedContent · Block
Public ProfileContent · Block
Map FrameMaps
Map ControlsMaps
Map MarkerMaps
Map LegendMaps
Place CardMaps
Route SummaryMaps
Dashboard ShellApplication · Block
Settings PageApplication · Block
Profile PageApplication · Block
Team ManagementApplication · Block
Notification CenterApplication · Block
Billing PortalApplication · Block
Search ResultsApplication · Block
Resource ManagerOperations · Block
Data ExplorerOperations · Block
Import WorkflowOperations · Block
Approval QueueOperations · Block
Audit Log ViewerOperations · Block
Incident DashboardOperations · Block
Report BuilderOperations · Block
Document FieldBrazil
CEP FieldBrazil
Pix PaymentBrazil
Installment PickerBrazil