Summary Card
The at-a-glance header for a plan or an overview.
≈ 833 tokens per use (tool 563 · guidance 175 · typical payload 95)How token costs are estimated
Example: Summary Card
Plan a Sunday lamb roast for friends. Numbers aren't final yet.
Sunday roast with friends
A flexible menu that scales with headcount.
- Style
- Cozy, slightly elevated
- Prep
- Mostly done ahead
- Cooking
- 2–3 hours
- Serving
- Family-style
When to use
- You're opening a plan or overview with several key attributes the user will scan: a trip, an event, an incident, a project.
- The details follow below, and the user needs the shape of it first.
When not to use
- There's one fact to report. Say it in a sentence.
- You're listing many records with the same fields. Use a Data Table.
- The facts would be filler, like "Difficulty: Easy" when nobody asked.
How the agent should use it
- Use it once, at the top of the reply. It frames what follows.
- Keep the facts to 2–6 short label/value pairs, in the order the user cares about.
- Only set
badgefor a real state, like "Resolved". Never use it as decoration.
Installation
npx shadcn@latest add https://your-site.com/r/summary-card.json
Usage
The Summary Card is display-only, so the tool can return immediately:
import { tool } from "ai"
import { summaryCardTool } from "@/components/genui/summary-card.schema"
const tools = {
[summaryCardTool.name]: tool({
description: summaryCardTool.description,
inputSchema: summaryCardTool.inputSchema,
execute: async () => ({ shown: true }),
}),
}Render it through the Renderer under show_summary, or directly:
<SummaryCard {...part.input} status={part.state === "input-streaming" ? "streaming" : "ready"} />With LangGraph
Push it from a graph node with ui.push({ name: "show_summary", props }, { message }), and render the thread's UI messages with the Renderer.
Schema
| Prop | Type | Notes |
|---|---|---|
title | string | What this is |
summary | string? | One or two framing sentences |
badge | string? | A real state, up to 24 characters |
facts | { label, value }[] | 2–6 facts. Data-bound when they describe real records |
Host props: status (streaming or ready) and className.