Componentmedia0.89 KB gzipZero dependencies
Megaphone
Announcement megaphone with animated sound waves.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add megaphoneOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { Megaphone } from "@/components/ui/megaphone"; <Megaphone />Source code
megaphone.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| message | string | Configures message. |
| onAnnounce | () => void | Callback invoked on announce. |