chat-bubble-bottom-center-text
An animated chat-bubble icon for React whose two text lines draw in and out when hovered or when the parent calls startAnimation through a ref. It is built on motion/react and renders an inline SVG at a configurable size.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @heroicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { ChatBubbleBottomCenterTextIcon } from "@/components/ui/chat-bubble-bottom-center-text";export function Example() { return <ChatBubbleBottomCenterTextIcon size={28} className="text-foreground" />;}- Showing a chat, message, or conversation entry point in a navigation bar, sidebar, or toolbar.
- Adding a subtle hover-triggered micro-interaction to a messaging or support button.
- Indicating that a message or comment is being composed, or that a conversation is available, with a controlled animation.
- Replacing a static chat icon where a lightweight animated icon fits the design.
Examples
Hover-animated icon in a button
The default hover behavior plays the text-line animation when the pointer enters the wrapper div. No ref is needed.
import { ChatBubbleBottomCenterTextIcon } from "@/components/ui/chat-bubble-bottom-center-text";export function ChatButton() { return ( <button type="button" className="inline-flex items-center gap-2 rounded-md border px-3 py-2"> <ChatBubbleBottomCenterTextIcon size={20} /> <span>Chat</span> </button> );}Imperative control through a ref
Setting a ref switches the component into controlled mode, so the default hover animation is disabled and the parent triggers startAnimation or stopAnimation.
import { useRef } from "react";import { Button } from "@/components/ui/button";import { ChatBubbleBottomCenterTextIcon, type ChatBubbleBottomCenterTextIconHandle,} from "@/components/ui/chat-bubble-bottom-center-text";export function NotifyButton() { const iconRef = useRef<ChatBubbleBottomCenterTextIconHandle>(null); return ( <Button variant="outline" onClick={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} > <ChatBubbleBottomCenterTextIcon ref={iconRef} size={18} /> New message </Button> );}Decorative icon in a sidebar link
When the icon sits next to a visible text label, hide it from assistive technology and pass a custom class for color and spacing.
import { ChatBubbleBottomCenterTextIcon } from "@/components/ui/chat-bubble-bottom-center-text";export function SidebarChatLink() { return ( <a href="/messages" className="flex items-center gap-3 text-sm font-medium"> <ChatBubbleBottomCenterTextIcon aria-hidden="true" className="text-muted-foreground transition-colors hover:text-foreground" size={24} /> Messages </a> );}API reference
Accessibility
- The SVG has no role, title, or aria-label, so it is not announced by screen readers on its own. If the icon conveys meaning without adjacent text, add role="img" and an aria-label to the wrapper, or wrap it in a labeled button or link.
- When the icon is placed next to visible text, pass aria-hidden="true" so the decorative graphic is skipped.
- Attributes such as aria-label and role are applied to the wrapping div through the spread props, not to the svg element.
- The hover and ref animations do not check prefers-reduced-motion. Consider disabling the controlled startAnimation call or using a CSS media query when users request reduced motion.
- The icon has no focus behavior of its own. Keyboard users only trigger the animation if the parent exposes it through focus or click handlers that call startAnimation.
Docs written by anthropic:claude-haiku-5-5 from the registry source.
Use with Coding Agent
Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.
Use the "chat-bubble-bottom-center-text" component (heroicons-animated/chat-bubble-bottom-center-text) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/chat-bubble-bottom-center-text2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, onMouseEnter, onMouseLeave, ref, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ChatBubbleBottomCenterTextIcon } from "@/components/ui/chat-bubble-bottom-center-text";export function Example() { return <ChatBubbleBottomCenterTextIcon size={28} className="text-foreground" />;}```Files & dependencies
- chat-bubble-bottom-center-text.tsx