Vercel's integration of json-render into the Chat SDK simplifies the delivery of rich, structured user interfaces inside conversational agents.
How it works
Developers create a typed catalogue using @json-render/core and standard components from @json-render/chat. This catalogue provides a system prompt to the LLM (demonstrated with anthropic/claude-haiku-5.5). The model streams back a JSON specification, which streamCard renders incrementally into the destination thread as elements arrive, throttling message edits to 500 ms intervals.
Validation and Platform Caps
- Spec validation: The
toCard function verifies element attributes against schema definitions. If invalid attributes are encountered, a CardSpecError is thrown with descriptive feedback, allowing systems to prompt the LLM for a corrected spec.
- Adapter degradation: Because chat providers restrict message complexity, adapters handle oversized content gracefully. For example, Slack degrades a second table into raw code blocks, though developers can configure
limits to reject oversized specs outright.