Insight cards

A React component in Beamline's Dashboard category.

Findings from an agent, one per page: the sentence, the series it is about with their change, a chart to scrub that names each point, and a follow-up question.

Use it for

  • Agent-generated findings with a supporting chart and a next question.

Not for

Anatomy

  • root (a size container)
  • header (title, page dots with a travelling pill — or the count past 8 pages — previous, next)
  • slide: summary, series legend with change (and amount when there is room), chart (lanes, scrub guide), question button; from 42rem the summary and question stand beside the chart

States

  • page
  • scrubbing (the legend reads the point's values and its name)
  • narrow (under 20rem: amounts fold away, the change stays)
  • wide (from 42rem: finding beside the chart)
  • pointed series (a series under the pointer in the legend comes forward in its lane; the others step back at once and return over --pui-motion-out)

Keyboard

  • ← → on the chart read points; Home and End jump to the first and last
  • On the page dots (one tab stop): ← → (mirrored in RTL) page, Home and End go to the first and last
  • Previous and next buttons page; the new page's place is announced

Motion

A page slides 16 px and fades in from the side it was asked for (next from the end, previous from the start, mirrored in RTL) while the old one leaves by the other, over --pui-duration-page; the dots' pill travels and stretches toward the new page (the shared glide). Reduced motion: pages cross-fade, the pill moves at once.

Props

PropTypeDefaultDescription
pages{ id, summary, series: { label, change, amount?, points, color? }[], labels?, format?, question? }[]—Pages of insights in display order. Required.
index / defaultIndex / onIndexChangenumber—index: Controlled zero-based index of the displayed item; omit to use defaultIndex. defaultIndex: Initial visible item index when uncontrolled. Defaults to 0. onIndexChange: Reports visible item index after a change; no callback by default.
onAsk(question, page) => void—Runs the request using the entered question; no handler by default.
classNamesInsightCardsClassNames—Classes for the named visual parts; no part overrides by default.
style / refCSSProperties / Ref<HTMLElement>—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
titlestring—Heading. Default "Insights".
indexnumber—Controlled zero-based index of the displayed item; omit to use defaultIndex.
defaultIndexnumber—Initial visible item index when uncontrolled. Defaults to 0.
onIndexChange((index: number) => void)—Reports visible item index after a change; no callback by default.
classNamestring—Classes on the documented visual root; no override by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
refRef<HTMLElement>—Receives the documented root element; no ref by default.

Built from

Dependencies

lucide-react, motion

Import

import { InsightCards } from "@beamline/insight-cards";

Get it

Insight cards is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in Dashboard

  • Explainable total: A total that answers "why this much?" in place: it unfolds into the steps that made it — a waterfall whose bars start where the last step ended, each…
  • Explainable change: A metric whose change explains itself: at rest the value, the change against a named period and a thin ribbon of its causes under the change; opened in…
  • Budget vessels: Budgets as glasses of money: the liquid is what is left (free money on top, committed money as a lighter layer under it), the lip at the period's budget…
  • Tracker: A row of status blocks for uptime, job runs or daily checks, with tooltips and a legend.
  • Metric card: A KPI that fills its tile: label, a value that rolls to each new number, the change with arrow, sign and tone, what it compares with and the value it…
  • Category bar: One bar split into labelled ranges with an optional marker that names its range.
  • Bar list: Ranked horizontal bars, label and value over a meter, one line per row when there is room — top pages, sources, customers.
  • App shell: The frame for every app screen: collapsible sidebar with grouped navigation, top bar and page.

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.