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
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add announcement-barOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { AnnouncementBar } from "@/components/ui/announcement-bar"; <AnnouncementBar />Source code
announcement-bar.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| variant | AnnouncementBarVariant | Visual theme variant |
| badgeLabel | string | Micro uppercase category eyebrow tag |
| title | React.ReactNode | Main announcement headline |
| description | React.ReactNode | Secondary announcement text or details |
| targetDate | Date | string | Target expiration date for live ticking countdown urgency |
| countdownSeconds | number | Total countdown duration in seconds if no fixed date is used |
| countdownLabel | string | Prefix label for countdown badge (e.g. 'ENDS IN' or 'PASS SALE') |
| urgencyText | string | Static urgency badge text if no countdown date is specified |
| actionLabel | string | Text label for the ticket CTA action button |
| actionHref | string | Optional href link destination for the CTA button |
| onAction | () => void | Click handler for the CTA button |
| dismissible | boolean | Whether the announcement can be closed by the user |
| onDismiss | () => void | Callback fired when the announcement is dismissed |
| open | boolean | Controlled visibility state |
| defaultOpen | boolean | Initial visibility state when uncontrolled |
| sticky | boolean | Whether to stick to the top of the viewport |
| icon | React.ReactNode | Custom leading icon element |
| className | string | Additional custom class names |
| children | React.ReactNode | Children content replacing default text layout |