ProUnlock everything for $49.99 a year, or $79.99 once. See plans ›

Nexus UI

Diff Review, animated React component

An inline review of AI edits to a paragraph, with removals struck through in red and additions typed in green. Accept all folds the old words away, Reject folds the new ones away, and clicking a single change takes just that one.

  • Pro
  • AI Components

Chimes softly when you press Accept all, switches off with a quiet click on Reject and taps when you take a single change; autoplay makes the accept sound once the visitor has used the page. Sound is off on this site until you switch it on.

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

Homepage · Hero copyDraft

Our app helps teams manage projects. Try it free for 14 days.

Props

PropTypeDefaultWhat it does
partsDIFF_REVIEW_PARTSThe paragraph as [kind, text] runs, where kind is "same", "del" or "ins". A del followed by an ins is one replacement; a lone del is a removal.
title"Homepage · Hero copy"Small label above the text box.
width520Width of the card in px. It never grows past its container.
autoplayfalseImproves the writing, accepts every edit and returns to the draft on a loop until someone touches the card. Only runs while the card is on screen and never under reduced motion.
className""Extra classes for the card.
enableSoundtruePlays interface sounds on interaction. They follow the sound switch (setSoundsEnabled, on by default) and stay silent on hover. Autoplay makes the same sounds once the visitor has used the page. Pass false to silence this component.

Diff Review questions

Does it make sound, and how do I turn it off?

Chimes softly when you press Accept all, switches off with a quiet click on Reject and taps when you take a single change; autoplay makes the accept sound once the visitor has used the page. Sounds are synthesised with the Web Audio API, so there are no audio files, and they only play after a click or key press. Pass `enableSound={false}` to silence this component, or call `setSoundsEnabled(false)` from `@/lib/ui-sounds` to switch every sound off at once. The CLI installs `@/lib/ui-sounds` with the component.