reopt design
DocsExploreTemplatesCanvasToolsPricing
Login
opt-uiopt-chartsopt-datagridopt-editoropt-calendaropt-filemanageropt-chatopt-shellbrandapp-ui
Overview205Core74Shells99Blocks32
CodeSnippetViewer
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.

CodeSnippetViewer

Shell

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

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

Live preview

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

100%
analytics.ts
1import { track } from "@reopt-ai/analytics";
2
3// Track a page view event
4track("page_view", {
5 path: window.location.pathname,
6 referrer: document.referrer,
7 title: document.title,
8});
terminal-theme.ts
1import { track } from "@reopt-ai/analytics";
2
3// Track a page view event
4track("page_view", {
5 path: window.location.pathname,
6 referrer: document.referrer,
7 title: document.title,
8});
9
10const longLine = "가로 스크롤과 키보드 포커스를 확인하기 위한 매우 긴 코드 줄입니다.".repeat(4);

CodeSnippetViewer

PropTypeDefaultDescription
codeRequiredstring—표시할 코드 문자열
languagestring"text"코드 언어 라벨
titlestring—헤더에 표시할 제목
showLineNumbersbooleantrue줄 번호 표시 여부
showCopyButtonbooleantrue복사 버튼 표시 여부
maxHeightnumber400스크롤 영역의 최대 높이(px)
syntaxTheme"default" | "muted" | "dark" | "terminal""default"코드 블록 색상 톤
classNamestring—커스텀 CSS 클래스
labelsCodeSnippetViewerLabels—복사 버튼과 코드 영역 레이블 문구

컴포넌트 의존 관계

깊이
▲ USED BY (2)project-settingsproject-overviewCodeSnippetViewer
View test results

테스트 커버리지

2026년 7월 9일6/6 통과
6성공
0실패
6전체
  • 코드를 렌더링한다
  • title을 표시한다
  • 줄 번호를 표시한다
  • Copy 버튼을 표시한다
  • 스크롤 영역을 키보드 포커스 가능한 region으로 노출한다
  • syntaxTheme로 코드 블록 톤을 바꾼다

Blocks that use this component

opt-ui

ProjectOverview

Blocks

Summarize a project with metrics, navigation cards, charts, tables, code snippets, and dashboard management.

opt-ui

ProjectSettings

Blocks

Manage project settings, retention policies, cleanup previews, and storage usage with forms, tables, and code snippets.

Related components

opt-ui

EditorToolbar

Shells

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

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

CodeDiffViewer

Shells

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

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.

PreviousWorkflowCanvasNextPropertyExplorer