Skip to content
Viewership Inquire
Astro UI

Chat.

Tabbed chat panel with reasoning replies and a growing composer.

AgentComponentNo dependencies Beautiful UI, MIT

.md
Compare this week's sessions to last week
GA4 Pull Analytics Data for 4s

Pulled sessions by channel for the last three weeks.

Comparison Trend Detection for 2s

Sessions are up 12%, led by organic search and Reddit referrals.

Install

  1. Import the foundation once

    foundation.css holds the tokens every component reads.

    Layout.astro
    ---
    // src/layouts/Layout.astro
    import "../styles/foundation.css";
    ---
  2. Copy ChatComposer.astro

    Paste into src/components/viewership/chat-composer/

  3. Use it

    Page.astro
    ---
    import ChatComposer from "../components/viewership/chat-composer/ChatComposer.astro";
    ---
    
    <ChatComposer />

Props 5

PropTypeDefaultDescription
threads { label: string; prompt?: string; replies?: { label; sub; time; body }[] }[] [{ label: "Chat" }] One tab per thread, with an opening prompt and replies.
active number 0 Initially selected tab.
placeholder string "Ask anything" Composer placeholder.
demo boolean false Add the user's message and replay scripted replies. Off by default; the component only emits `vs-chat-submit`.
labels { tabs?, input?, send?, newChat?, history?, more?, for? } · Accessible names, plus the word between a reply's sub-label and time.

Source 1 file

Ported from Beautiful UI, MIT. Notices.