OfferLifetime Pro for $99

Insight Cards

A metric card with the last few periods as small bars, the latest in full ink, and a delta with an arrow. Under it one sentence explains the move, with a skeleton while it is written or an Explain button when you would rather ask. Hover or arrow along the bars to read a period.

The decision inside it

Colour says good or bad, the arrow says up or down

A rise in failed sends is bad news. tone keeps the arrow honest about direction and lets the colour say whether the move is welcome, and the words are there for screen readers either way.

When to use it

Use Insight Cards for a headline number that needs a reason: the last few periods as bars, a delta, and one sentence on why it moved. Pass tone "negative" when a rise is bad, and noteLoading while the explanation is written.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Layro's Insight Cards for this.
Install it: npx shadcn@latest add @layro/insight-card
(the @layro registry is set up in components.json, with LAYRO_KEY in .env.local)
Import it from @/components/ui/insight-card.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @layro registry with your CLI token: see the Namespaced tab.

Usage

components/week-insights.tsx
import { InsightCard } from "@/components/ui/insight-card";

export function WeekInsights({ note, writing }: { note?: string; writing: boolean }) {
  return (
    <div className="grid gap-3 md:grid-cols-3">
      <InsightCard
        label="Documents signed"
        value="1,284"
        delta={0.124}
        deltaLabel="vs last week"
        trend={[820, 905, 870, 1010, 1092, 1150, 1210, 1284]}
        note={note}
        noteLoading={writing}
      />
      <InsightCard label="Failed sends" value="23" delta={0.64} tone="negative" trend={[12, 9, 14, 11, 13, 15, 19, 23]} />
    </div>
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

PropTypeNotes
labelrequiredstring—
valuerequiredstring | number—
deltanumberChange vs the previous period, as a fraction: 0.124 = +12.4%.
deltaLabelstringWhat the delta compares against. Default "vs last period".
trendnumber[]The last few periods, oldest first. The last one is `value`'s period.
trendLabelsstring[]A name per trend bar for the hover readout: "Mon", "Week 41".
format(v: number) => stringFormats the trend values in the readout.
noteReact.ReactNodeOne sentence on why the number moved.
noteLoadingbooleanThe note is being written.
toneInsightToneWhether the move is good. Default "auto": up is good.
onExplain() => voidShows an Explain button when there is no note yet.
classNamestring—

Dependencies

npm packages

clsxlucide-reacttailwind-merge

Layro foundations, installed alongside it

layro-themestate

States

All of them are drawn by the component. None is left for you to design.

  • Default
  • Writing the note
  • Explain on request
  • No change

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances

Lifetime access

Every component, and everything we ship next.

  • All 232 components, source included
  • Every template, and everything released after you buy
  • shadcn CLI or download — React 18/19, Tailwind v4
  • One payment. No subscription.