Skip to content

Suggestion Comment

An agent proposes a change as a comment: why, a word diff of the text it would change, and Apply or Dismiss. Nothing changes until you apply, and the card folds to one line with Undo.

On this page
Used for
  • Agent edits to copy
  • Review before it changes
  • Suggested rewrites
  • Docs and specs

Examples

Installation

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Props

author
CommentAuthor
Who suggests it, usually an agent with its mark.
note
ReactNode
Why, in a sentence.
before, after
string
The text now and after the change, shown as a word diff.
target
string
What it changes: "Onboarding copy".
status
"open" | "applying" | "applied" | "dismissed"
Default"open"
Applied and dismissed fold to one line.
onApply, onDismiss, onUndo
() => void
Undo shows on the folded line.

Accessibility

  • The card is a region named "Claude suggests a change to Onboarding copy".
  • The diff reads removed and added words in order; the result line is a status, so screen readers hear "Applied by you".

What it handles

  1. 01Shows why, then the change as a word diff of the text, so the person reads one sentence instead of two versions.
  2. 02Changes nothing until Apply; Dismiss and Apply fold the card to one line with Undo.
  3. 03Keeps Apply busy while your call runs and lets the person back out with Undo after.

States

First render
The card sits open; nothing plays
none
Apply or Dismiss
The diff folds away and the result line unfolds
180ms ease out
Applying
Apply shows its spinner
button loading
Reduced motion
The lines swap at once
0ms

Works with

When to use

When to use

  • An agent proposing an edit to copy, a spec or a doc that a person applies or dismisses.
  • Any change that must be read before it lands, shown as a small word diff with a reason.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Suggestion Comment to my app and wire it to my own data.
  • I need an agent proposing an edit to copy, a spec or a doc that a person applies or dismisses. Set that up with the Knowns UI Suggestion Comment.
  • Which Suggestion Comment props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "suggestion-comment" }) and search_docs({ query: "suggestion comment" }). Pro props, full examples and source come back once your license key is in the MCP config.

Need help?

Stuck on Suggestion Comment, or found something off? We read every message.