Broadcast composer
Choose a channel, edit a short bulletin, and post it to the station’s local board.
Installation
Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/broadcast-composer.json
Usage
import { Cyber } from "@/components/ui/cyber"
import Recipe from "@/components/recipes/broadcast-composer"
export default function App() {
return (
<Cyber>
<Recipe />
</Cyber>
)
}
Source
"use client"
import { useState } from "react"
import { Send } from "lucide-react"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { Select } from "@/components/ui/select"
import { Textarea } from "@/components/ui/textarea"
import "./recipe-layout.css"
const channels = ["Ferry desk", "Night studio", "All districts"]
export default function BroadcastComposer() {
const [channel, setChannel] = useState(channels[0])
const [draft, setDraft] = useState("Last ferry boards at the south pier. Have your pass ready.")
const [posted, setPosted] = useState<{ channel: string; body: string } | null>(null)
return (
<div className="sink-stack">
<form className="sink-stack" onSubmit={event => {
event.preventDefault()
const body = draft.trim()
if (!body) return
setPosted({ channel, body })
setDraft("")
}}>
<Select label="Broadcast channel" value={channel} onValueChange={value => { if (value) setChannel(value) }}
options={channels.map(name => ({ label: name, value: name }))} />
<Textarea label="Bulletin" value={draft} onValueChange={setDraft} maxLength={160} rows={2}
placeholder="Write a short bulletin" />
<div className="sink-row">
<Button tone="signal" size="sm" type="submit" disabled={!draft.trim()}><Send aria-hidden /> Post bulletin</Button>
</div>
</form>
<div role="status">
{posted && <div className="sink-stack">
<div className="sink-row"><Badge tone="ok">Posted</Badge><strong>{posted.channel}</strong></div>
<p>{posted.body}</p>
</div>}
</div>
</div>
)
}