Skip to content
Viewership Inquire
Astro UI

Recommendation Card.

Agent suggestion with a confidence meter and alternatives.

AgentComponent3 dependencies Beautiful UI, MIT

.md
Want me to move this week's ad budget?

Shift budget to Northwind Spring Search with ROAS 4.2x

Other options

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 RecommendationCard.astro

    Paste into src/components/viewership/recommendation-card/

  3. Copy its dependencies

    Each in its own folder, next to this one.

  4. Use it

    Page.astro
    ---
    import RecommendationCard from "../components/viewership/recommendation-card/RecommendationCard.astro";
    ---
    
    <RecommendationCard />

Props 4

PropTypeDefaultDescription
title string · The agent's question.
options RecommendationOption[] · { key, body, short, signal (0–3), tone, label, cta, ctaVariant? }. body is a string or parts: strings, { entity, color? }, { value, tone? }, { strong }.
selected number 0 Initial option index.
labels Partial<RecommendationLabels> · alternatives, otherOptions, accepted, confidence (meter name).

Events

EventDetailWhen
vs-recommendation-accept CustomEvent<{ key: string; index: number }> Fires on accept. The card only shows "Accepted"; do the work in your handler.
vs-recommendation-select CustomEvent<{ key: string; index: number }> Fires when an alternative is promoted.
vs-recommendation-toggle CustomEvent<{ open: boolean }> Fires when the drawer toggles.

Source 1 file

Ported from Beautiful UI, MIT. Notices.