Skip to content
Viewership Inquire
Astro UI

Diff Table.

AI-proposed table edits you include or skip, then apply.

DataComponent1 dependency Beautiful UI, MIT

.md
Proposed content cleanup Click changed rows to toggle
AssetChannelOwner
Old FAQ Post , proposed removal
Blog
dana-w
Recap Thread , proposed removal
Social
marcus-t
Trail Guide
Blog
priya-s
Gear Care Email , proposed addition
Email
dana-w

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

    Paste into src/components/viewership/diff-table/

  3. Copy its dependencies

    Each in its own folder, next to this one.

  4. Use it

    Page.astro
    ---
    import DiffTable from "../components/viewership/diff-table/DiffTable.astro";
    ---
    
    <DiffTable />

Props 6

PropTypeDefaultDescription
columns { key: string; label: string; width?: string; kind?: "title" | "tag" | "text" }[] · Column order and headers. The first column names the row.
rows { key: string; cells: Record<string, string>; change?: "remove" | "add" }[] · Table data. Rows with `change` are proposed edits.
tagTones Record<string, "accent" | "neutral" | "green" | "orange" | "red"> {} Dot color per tag value.
labels Partial<DiffTableLabels> · Text overrides: title, hint, removal(s), addition(s), apply, applied, includeRemove, includeAdd, removedRow, addedRow.
autoplay boolean true Play when scrolled into view. Reduced motion and no-JS show the final diff.
loop boolean false Replay after a 4s hold until interaction.

Events

EventDetailWhen
vs-diff-toggle CustomEvent<{ key: string; included: boolean }> Fires when a change is included or skipped.
vs-diff-apply CustomEvent<{ removed: string[]; added: string[]; skipped: string[] }> Fires on Apply with row keys by kind. The table only shows a confirmation.

Source 1 file

Ported from Beautiful UI, MIT. Notices.