Componentfeedback2.11 KB gzipZero dependencies

Announcement Bar

Festival alert and headline announcement ribbon bar with perforated top/bottom tear lines, countdown urgency badge, action CTA button, and dismiss action.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add announcement-bar

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { AnnouncementBar } from "@/components/ui/announcement-bar"; <AnnouncementBar />

Source code

announcement-bar.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxannouncement-bar.tsx357 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export type AnnouncementBarVariant = "festival" | "urgent" | "accent" | "default"; export interface AnnouncementBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {  /** Visual theme variant */  variant?: AnnouncementBarVariant;  /** Micro uppercase category eyebrow tag */  badgeLabel?: string;  /** Main announcement headline */  title?: React.ReactNode;  /** Secondary announcement text or details */  description?: React.ReactNode;  /** Target expiration date for live ticking countdown urgency */  targetDate?: Date | string;

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { AnnouncementBar } from "@/components/ui/announcement-bar"; <AnnouncementBar />
PropTypeDescription
variantAnnouncementBarVariantVisual theme variant
badgeLabelstringMicro uppercase category eyebrow tag
titleReact.ReactNodeMain announcement headline
descriptionReact.ReactNodeSecondary announcement text or details
targetDateDate | stringTarget expiration date for live ticking countdown urgency
countdownSecondsnumberTotal countdown duration in seconds if no fixed date is used
countdownLabelstringPrefix label for countdown badge (e.g. 'ENDS IN' or 'PASS SALE')
urgencyTextstringStatic urgency badge text if no countdown date is specified
actionLabelstringText label for the ticket CTA action button
actionHrefstringOptional href link destination for the CTA button
onAction() => voidClick handler for the CTA button
dismissiblebooleanWhether the announcement can be closed by the user
onDismiss() => voidCallback fired when the announcement is dismissed
openbooleanControlled visibility state
defaultOpenbooleanInitial visibility state when uncontrolled
stickybooleanWhether to stick to the top of the viewport
iconReact.ReactNodeCustom leading icon element
classNamestringAdditional custom class names
childrenReact.ReactNodeChildren content replacing default text layout