Callout

The one notice in a reply the user must not miss.

Pattern

≈ 475 tokens per use (tool 263 · guidance 176 · typical payload 36)How token costs are estimated

Example: Callout

How long should I roast a 2.4 kg leg of lamb?

When to use

  • There's a safety issue, an irreversible consequence, a legal or allergy concern, or a hard deadline.
  • A caveat would change what the user does, like "Stock levels are from 2 hours ago".

When not to use

  • To restate or emphasize the answer itself.
  • For general tips or nice-to-knows. Put them in the text.
  • More than once in a reply. If everything is highlighted, nothing is.

Tones

ToneUse for
noteContext that changes how the user reads the answer
warningA risk or caveat they should act on
criticalReal harm or an irreversible action

The tone changes only the icon and the title color, on one quiet surface. There are no colored side stripes or one-color boxes, so a callout stands out because it's rare, not because it's loud. Screen readers hear the tone as a prefix ("Warning: …").

How the agent should use it

  • At most one callout per reply.
  • Pick the lowest tone that fits. Reserve critical for real harm or irreversible actions.
  • Be specific: numbers, names and dates. Add source when the rule comes from somewhere.

Installation

npx shadcn@latest add https://your-site.com/r/callout.json

Usage

The Callout is display-only, so the tool can return immediately:

app/api/chat/route.ts
import { tool } from "ai"
import { calloutTool } from "@/components/genui/callout.schema"

const tools = {
  [calloutTool.name]: tool({
    description: calloutTool.description,
    inputSchema: calloutTool.inputSchema,
    execute: async () => ({ shown: true }),
  }),
}

With LangGraph

Push it from a graph node with ui.push({ name: "show_callout", props }, { message }), and render the thread's UI messages with the Renderer.

Schema

PropTypeNotes
tonenote | warning | criticalDefault note
titlestring?A few words
textstringOne or two sentences, up to 400 characters
source{ label, url? }Data-bound. Only http(s) URLs become links

Host props: status (streaming or ready) and className.

Source

On this page