Revert To AI Toggle

Revert To AI Toggle

AI
Transparency

Toggle between AI-generated and human-edited content versions with visual diff indicators. Helps users compare original AI output with manual edits.

Preview

Click the toggle to switch between AI and human-edited versions

Content Version
Currently showing: AI-generated

Based on our analysis, we recommend implementing a mobile-first redesign approach for your platform. This will maximize user engagement and retention based on current usage patterns.

This version differs from the human-edited version

Props

RevertToAIToggle component API reference

PropTypeDefaultDescription
isAIVersion*boolean—Whether AI version is currently displayed
onToggle*(useAI: boolean) => void—Callback when toggle is clicked
aiVersion*string—The AI-generated content
humanVersion*string—The human-edited content
showDiffbooleanfalseShow diff indicator when versions differ
classNamestring—Additional CSS classes

Usage

Import and implementation example

import { RevertToAIToggle } from '@/components/ui/revert-to-ai-toggle'
export default function Example() {
const [isAIVersion, setIsAIVersion] = useState(true)
return (
<RevertToAIToggle
isAIVersion={isAIVersion}
onToggle={(useAI) => setIsAIVersion(useAI)}
aiVersion="AI-generated content here..."
humanVersion="Human-edited content here..."
showDiff={true}
/>
)
}
This block is self-contained (no UI component dependencies)

Features

Built-in functionality

  • Version comparison: Easily switch between AI and human-edited content
  • Diff indicator: Visual alert when versions differ
  • Segmented toggle: AI and Human segments built on ToggleGroup
  • Color-coded states: Sparkles icon for AI, user icon for human edits
  • Current version label: Clear indication of which version is displayed

Accessibility

Accessibility considerations

ARIA Attributes

Toggle group items are native buttons with pressed stateCurrent state indicated visually and in textDiff warning uses alert icon

Keyboard Navigation

KeyAction
TabFocus the toggle button
Enter / SpaceToggle between versions

Notes

  • Version type shown in text label
  • Color provides additional visual distinction
  • Diff message explains version difference
  • Current version label is an aria-live region