reopt design
DocsExploreTemplatesCanvasToolsPricing
Login
opt-uiopt-chartsopt-datagridopt-editoropt-calendaropt-filemanageropt-chatopt-shellbrandapp-ui
Overview205Core74Shells99Blocks32
CodeDiffViewer
reopt designreopt design

A design system for the AI era

  • Docs
  • Pricing
  • Releases
  • About
  • Contact
  • Terms of Service
  • Privacy Policy

reopt Inc.Business registration no. 217-88-02453contact@reopt.ai

© 2026 reopt Inc. All rights reserved.

CodeDiffViewer

Shell

Compare code in unified or split views using an LCS diff and focusable scroll regions.

editor
Related docs
bun add @reopt-ai/opt-ui
Install and import
bash
bun add @reopt-ai/opt-ui
tsx
import { CodeDiffViewer } from "@reopt-ai/opt-ui";

Live preview

Change the width and theme, then interact with the components.

100%
1- function greet(name) {
2- console.log("Hello " + name);
1+ function greet(name: string) {
2+ console.log(`Hello ${name}`);
3+ console.log("Done");
34 return true;
45 }
1- function greet(name) {
2- console.log("Hello " + name);
3 return true;
4 }
1+ function greet(name: string) {
2+ console.log(`Hello ${name}`);
3+ console.log("Done");
4 return true;
5 }

CodeDiffViewer

PropTypeDefaultDescription
originalRequiredstring—원본 코드
modifiedRequiredstring—수정된 코드
mode"split" | "unified""unified"뷰 모드
showLineNumbersbooleantrue줄 번호 표시
scrollLabelstring—스크롤 가능한 diff 영역의 접근성 레이블
classNamestring—커스텀 CSS 클래스
View test results

테스트 커버리지

2026년 7월 9일2/2 통과
2성공
0실패
2전체
  • 추가된 라인에 + 접두사를 표시한다
  • 스크롤 가능한 diff 영역을 키보드 포커스 가능한 region으로 노출한다

Related components

opt-ui

EditorToolbar

Shells

Build a rich-text editing toolbar from Toolbar and Tooltip components.

opt-ui

CodeSnippetViewer

Shells

Read and copy code snippets with line numbers, a focusable scroll region, and syntaxTheme styling.

opt-ui

SqlEditor

Shells

Edit SQL with CodeMirror syntax highlighting and autocomplete.

opt-ui

RichTextEditor

Shells

Edit Markdown with a formatting toolbar and textarea.

opt-ui

FaqAccordion

Shells

Organize FAQ questions and answers with Composite and Disclosure components.

opt-ui

PageAside

Shells

Add a sticky, fixed-width page aside with header, body, and footer slots.

PreviousRichTextEditorNextWebhookConfig