Staaarter

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.

By Staaarter Team
Chat
Docs
Live preview

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.json

Prefer 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

PropTypeDefaultDescription
agentNamestring"Support"Name shown in the widget header.
greetingstring"Hi there! How can we help you today?"First agent message shown at the top of the thread.
messagesChat10Message[]noneMessage thread rendered below the greeting.
classNamestringnoneExtra 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.