Overlays & feedback / Toasts & snackbars

Sales Chat Floating Card

A white rounded card with a soft shadow in the bottom-right corner, showing overlapping round avatars, a green availability dot, a bold 'N sales reps available' heading, a muted line and a close icon. A dark navy 'Chat now' button sits below.

Rebuilt from stripe.com/pricing in the Iridescent Ledger style.

npx shadcn@latest add https://justyoink.it/r/iridescent-ledger/blocks/floating-sales-chat.json

Looks exactly like stripe.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Usage

Props: count, heading, message, buttonLabel, hideAfter/showAfter (scroll range in px where it is visible), onChat, onClose. Fixed bottom-right; the close icon dismisses it permanently.

components/floating-sales-chat.tsx
import { useEffect, useState } from "react";

type Props = {
  count?: number;
  heading?: string;
  message?: string;
  buttonLabel?: string;
  hideAfter?: number;
  showAfter?: number;
  onChat?: () => void;
  onClose?: () => void;
};

export default function SalesChatFloatingCard({
  count = 9,
  heading = "specialists online",
  message = "Ask us anything about setting up your team.",
  buttonLabel = "Start chat",
  hideAfter = 900,
  showAfter = 80,
  onChat,
  onClose,
}: Props) {
  const [dismissed, setDismissed] = useState(false);
  const [visible, setVisible] = useState(false);

  useEffect(() => {
    const update = () => {
      const y = window.scrollY;
      setVisible(y > showAfter && y < hideAfter);
    };
    update();
    const t = setTimeout(update, 50);
    window.addEventListener("scroll", update, { passive: true });
    return () => {
      clearTimeout(t);
      window.removeEventListener("scroll", update);
    };
  }, [hideAfter, showAfter]);

  if (dismissed) return null;
  const show = visible || (typeof window === "undefined");

  return (
    <div
      className={`fixed bottom-6 right-4 z-50 flex w-[calc(100%-2rem)] max-w-[350px] flex-col items-end gap-4 transition-[opacity,transform] duration-300 ease-[cubic-bezier(0.25,1,0.5,1)] motion-reduce:transition-none sm:right-6 ${show ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-8 opacity-0"}`}
      aria-hidden={!show}
    >
      <div className="relative w-full rounded-lg bg-surface p-4 shadow-floating">
        <button
          type="button"
          aria-label="Dismiss chat prompt"
          onClick={() => {
            setDismissed(true);
            onClose?.();
          }}
          className="absolute right-3 top-3 text-ink-faint transition-colors duration-link ease-link hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent rounded-pill"
        >
          <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true">
            <circle cx="10" cy="10" r="9" fill="currentColor" />
            <path d="M7 7l6 6M13 7l-6 6" stroke="#fff" strokeWidth="1.6" strokeLinecap="round" />
          </svg>
        </button>
        <div className="flex items-center gap-3 pr-8">
          <div className="flex -space-x-2">
            <span className="flex h-8 w-8 items-center justify-center rounded-pill border-2 border-surface bg-gradient-to-br from-signal-orange to-signal-magenta text-micro font-medium text-white">LM</span>
            <span className="flex h-8 w-8 items-center justify-center rounded-pill border-2 border-surface bg-gradient-to-br from-accent to-accent-soft text-micro font-medium text-white">RK</span>
          </div>
          <div className="flex items-center gap-1.5 text-ui font-semibold text-ink-deep">
            <span className="h-2 w-2 rounded-pill bg-[#2ca06a]" aria-hidden="true" />
            <span>{count} {heading}</span>
          </div>
        </div>
        <p className="mt-3 text-ui text-ink-muted">{message}</p>
      </div>
      <button
        type="button"
        onClick={onChat}
        className="rounded-sm bg-ink-deep px-6 py-2.5 text-ui font-medium text-white shadow-card transition-opacity duration-link ease-link hover:opacity-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent"
      >
        {buttonLabel}
      </button>
    </div>
  );
}

Quality checks

Automated, in a real browser · 5d ago
—

More from Iridescent Ledger

The whole style →

Checklist Feature Columns

Feature sections

Iridescent Ribbon Hero

Heroes

Dated Article Row

Blog & articles

Saturated Highlight Card Strip

Carousels

Frosted Hairline Header

Headers & nav bars

Sticky Pill Sub-Navigation

Tab bars