Back to components
ComponentAI & ChatFree

AI Edit Review React component

An AI text editor that rewrites a selected passage, streams a word-level diff review with accept/reject actions, and morphs a dock through writing, review, and applied states.

About the AI Edit Review component

AI Edit Review is a free inline AI editing surface: a paragraph with one highlighted passage and a dock underneath offering rewrite actions such as Improve, Shorten and Translate. Picking one makes the passage shimmer while a small particle orb works, then shows a word-level diff in place, with removed words struck through and added words streaming in, while the dock shows the added and removed word counts next to Reject and Accept.

The text is split into before, selected and after, and actions is a list of up to five { label, result } pairs; the component computes the diff between selected and each result itself. selectionColor, addColor and removeColor color the highlight and the diff, workColors, reviewColors and doneColors the edge glow, and the dock morphs its width for each state. onStart, onAccept and onReject report the user's choice, a live region reads the state and word counts, and actions started from the keyboard move focus to the next state's main button.

When to use it

Use it to build or demo AI writing features in editors, CMS fields, email composers or docs tools, where people must see exactly what the model changed before it is applied.

For free-form prompting instead of fixed rewrite actions, pair a text area with AI Chat Prompt.

Installation

Add the AI Edit Review component to your project with the shadcn CLI. It lands in components/ai-edit-review.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/ai-edit-review

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install clsx tailwind-merge

Related components

AI Chat
SEO-ready
AI Chat Prompt
SEO-ready
AI Answer 03
Free
Workspace Pulse Feed
Free
Threaded Replies
Free
Margin Notes Panel
Free