Componentmedia0.89 KB gzipZero dependencies

Megaphone

Announcement megaphone with animated sound waves.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

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

npx bigbullui add megaphone

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { Megaphone } from "@/components/ui/megaphone"; <Megaphone />

Source code

megaphone.tsx + 1 helper

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

tsxmegaphone.tsx50 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface MegaphoneProps extends React.HTMLAttributes<HTMLDivElement> {  message: string;  onAnnounce?: () => void;} /** Megaphone banner: broadcast message + animated soundwaves. */export function Megaphone({ message, onAnnounce, className, ...props }: MegaphoneProps) {  const [announcing, setAnnouncing] = React.useState(false);   const announce = () => {    setAnnouncing(true);    onAnnounce?.();    setTimeout(() => setAnnouncing(false), 2000);

Props

Interactive Prop Playground

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

tsx3 lines
import { Megaphone } from "@/components/ui/megaphone"; <Megaphone />
PropTypeDescription
messagestringConfigures message.
onAnnounce() => voidCallback invoked on announce.