Skip to content
Viewership Inquire
Astro UI

Insight Cards.

Paged agent insights with scrubbable SVG charts and follow-up prompts.

DataComponentNo dependencies Beautiful UI, MIT

.md

Insights (3 total)

The weakest channel for @Northwind is Paid Social: down -6% or -$2,453.

Paid Social -4.41% -$2,377
Organic Search +1.15% +$617
Revenue vs. last week Snapshot

Line chart from Mar 6 to Mar 13. Paid Social fell from -2.90% to -4.41% (high -2.90%, low -4.41%); Organic Search rose from +0.22% to +1.15% (high +1.15%, low +0.22%).

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 the 2 files

    Paste into src/components/viewership/insight-cards/

  3. Use it

    Page.astro
    ---
    import InsightCards from "../components/viewership/insight-cards/InsightCards.astro";
    ---
    
    <InsightCards />

Props 9

PropTypeDefaultDescription
pages InsightPage[] · { key, prose, card, pill? }. Prose tokens: string, { entity, color? }, { mono, tone }, { strong }. Types are in insight-chart.ts.
card (compare) { kind: "compare"; series: { name, values, sub, tone, color }[]; caption?; badge?; format?; labels? } · Two-series comparison with a scrubbable line chart.
card (anomaly) { kind: "anomaly"; title; metrics: { key, label, values, format, threshold }[]; total; delta; deltaNote; color?; labels? } · Line chart with a metric toggle.
card (allocation) { kind: "allocation"; title; segments: { name, label, pct, amount, color, tone? }[]; note; monogram?; color? } · Segmented bar with legend and detail box.
format { style: "percent" | "money" | "unit"; unit?; decimals?; signed?; currency? } · Value format in tooltips, readouts and summaries.
title string "Insights" Pager heading.
page number 0 Initial page.
autoplay / interval boolean / number false / 6000 Advance pages while in view. Pauses on hover or focus, stops on interaction, off with reduced motion.
Events CustomEvent · vs-insight-page { index, key }, vs-insight-ask { key, text }.

Source 2 files

Ported from Beautiful UI, MIT. Notices.