Skip to content
Viewership Inquire
Astro UI

Approval Card.

Questions an agent asks, one step at a time, before acting.

AgentComponent2 dependencies Beautiful UI, MIT

.md
Which angle should lead the spring campaign?
Which channels get the first draft?
How should we word the offer?

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

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

  3. Copy its dependencies

    Each in its own folder, next to this one.

  4. Use it

    Page.astro
    ---
    import ApprovalCard from "../components/viewership/approval-card/ApprovalCard.astro";
    ---
    
    <ApprovalCard />

Props 4

PropTypeDefaultDescription
questions { q: string; type: "radio" | "check"; options: string[] }[] · One step per question. Free-text answer always allowed.
labels Partial<ApprovalLabels> · Text overrides.
resettable boolean true Show Start over after sending.
autoAdvance boolean true Advance after a pointer or Space pick, not arrow keys.

Events

EventDetailWhen
vs-approval-submit CustomEvent<ApprovalAnswer[]> Fires on send. Skipped steps are empty.
vs-approval-change CustomEvent<{ index: number; answer: ApprovalAnswer }> Fires when a step's answer changes.
vs-approval-dismiss CustomEvent<{ index: number }> Fires on close, or Skip on the last step.

Source 1 file

Ported from Beautiful UI, MIT. Notices.