Floating Chat Widget with Expandable Window
A compact floating support-chat bubble, positioned like a corner widget. It carries a pulsing notification dot until opened, and expands into a small chat window with a header, a short message thread, and a composer row when clicked.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/floating-chat-widget.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/chat/chat10.tsx instead.
Usage
The file also exports chat10Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Chat10, chat10Demo } from "@/components/blocks/chat/chat10"; export default function Page() { return <Chat10 {...chat10Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| agentName | string | "Support" | Name shown in the widget header. |
| greeting | string | "Hi there! How can we help you today?" | First agent message shown at the top of the thread. |
| messages | Chat10Message[] | none | Message thread rendered below the greeting. |
| className | string | none | Extra classes for the outer wrapper element. |
Types
export interface Chat10Message { id: string; from: "agent" | "user"; text: string; }
Behavior notes
- The bubble-to-window open/close toggle is real client state (useState) with a Tailwind opacity/scale transition, not just CSS :hover.
- The pulsing notification dot (animate-ping) only shows while the widget is closed and is purely decorative, it doesn't track real unread counts.
- The composer input and send button are decorative, typing does update the native input value but there is no onSubmit/onClick handler wired to send anything.
- Positioned with a relative wrapper sized like a corner overlay rather than a page-covering fixed position, so it previews sensibly inside the block thumbnail/iframe instead of covering the whole page.
More Chat Blocks
View all →rich-prompt-input-with-suggestions
Rich Prompt Input with Smart Suggestions
An AI prompt composer with attachment icons, a model selector, and a grid of clickable prompt suggestion cards.
ai-streaming-response-typewriter
AI Streaming Response with Live Typing
A single AI chat exchange with a skeleton loading state, a word-by-word typewriter reveal, and a stop-generating control.
ai-response-with-cited-sources
AI Response with Cited Sources
A Perplexity-style answer with inline numbered citation markers and an expandable source list below it.
code-generation-chat-with-syntax-highlighting
Code Generation Chat with Syntax Highlighting
A developer chat message with a file-name tab bar, a language badge, illustrative syntax coloring, and a real copy button.
prompt-starter-grid
AI Prompt Starter Grid
A tabbed grid of prompt template cards, filterable by category, each with an icon, title, and description.
ai-agent-profile-card
AI Agent Profile Card
A showcase card for an AI agent with avatar, capability badges, a sample chat preview, stats, and action buttons.