{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "inbox-tab-bar-badges",
  "title": "Inbox Tab Bar Badges",
  "description": "A tab bar whose Inbox tab shows an unread count that reads aloud, updates as messages arrive or are read, caps at 99+ and announces new messages politely. Use this when a tab needs to show unread or pending counts that change while the app is open.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "@tealmac/tab-bar"
  ],
  "files": [
    {
      "path": "registry/patterns/inbox-tab-bar-badges/inbox-tab-bar-badges.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { HomeIcon, InboxIcon, UserIcon } from \"lucide-react\"\n\nimport { TabBar } from \"@/components/ui/tab-bar\"\n\nexport interface InboxTabBarBadgesProps {\n  unread: number\n  tab: string\n  onTabChange: (tab: string) => void\n}\n\nexport function InboxTabBarBadges({\n  unread,\n  tab,\n  onTabChange,\n}: InboxTabBarBadgesProps) {\n  const previous = React.useRef(unread)\n  const [announce, setAnnounce] = React.useState(\"\")\n\n  React.useEffect(() => {\n    if (unread > previous.current) setAnnounce(`New message, ${unread} unread`)\n    previous.current = unread\n  }, [unread])\n\n  return (\n    <>\n      <TabBar\n        label=\"Main\"\n        value={tab}\n        onValueChange={onTabChange}\n        items={[\n          { id: \"home\", label: \"Home\", icon: <HomeIcon /> },\n          { id: \"inbox\", label: \"Inbox\", icon: <InboxIcon />, badge: unread },\n          { id: \"me\", label: \"Profile\", icon: <UserIcon /> },\n        ]}\n      />\n      <p role=\"status\" className=\"sr-only\">\n        {announce}\n      </p>\n    </>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "type": "registry:block"
}