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

DataTable

Shell

Display generic tabular data with dynamic columns, safe sorting, keyboard resizing, an accessible grid label, and an optional title.

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

Live preview

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

100%

기본 사용

사용자 목록

이름이메일역할상태완료율
김철수kim@example.comAdmin활성0.82
이영희lee@example.comEditor활성1.2
박민수park@example.comViewer비활성—
최지은choi@example.comEditor활성-0.15
정우성jung@example.comViewer활성0.46

헤더를 눌러 정렬하고, 컬럼 경계에 포커스한 뒤 ←/→(Shift는 40px)로 너비를 바꿀 수 있습니다. 완료율은 범위를 벗어나거나 NaN이어도 0–100% 사이로 안전하게 표시됩니다.

빈 상태

등록된 사용자가 없습니다

Usage guidance

Best practices

  • Use a stable row ID for keyExtractor that survives sorting and filtering. Provide ariaLabel for the grid when there is no visible title.
  • Declare column accessors against the row type. Consider opt-datagrid when server queries, editing, or large-scale virtualization are needed.

Usage to avoid

  • Do not identify rows by array index or leave action-column headers unnamed. Use headerHidden to hide a named header visually.

Usage examples

Basic table
Selection and sorting

DataTable

PropTypeDefaultDescription
dataRequiredT[]—테이블 데이터 배열
columnsRequiredColumnDef<T>[]—컬럼 정의. { id, header, accessor, width?, align? }
keyExtractorRequired(row: T) => string—각 행의 고유 키 추출 함수
titlestring—테이블 위에 표시할 제목. 생략하면 제목 영역을 렌더하지 않음
ariaLabelstring—보이는 제목이 없을 때 grid에 제공할 접근 가능한 이름
onRowClick(row: T) => void—행 클릭 핸들러
emptyMessagestring"No data available"데이터 없을 때 표시할 메시지
labelsDataTableLabels—선택·리사이즈·펼치기처럼 스크린리더만 듣는 문구. 보이는 문구는 columns와 emptyMessage가 이미 호출자의 것입니다

ColumnDef

PropTypeDefaultDescription
headerHiddenbooleanfalse이름은 두되 그리지 않음. 행 액션처럼 제목이 필요 없는 컬럼용 — 빈 header는 컬럼을 익명으로 만듭니다
bar(row: T) => number—인라인 프로그레스 바 비율(0-1) 계산 함수. 범위 밖/NaN은 보정
barColorstring"bg-accent"인라인 바 색상 클래스

컴포넌트 의존 관계

깊이
▲ USED BY (17)▼ USES (3)tree-tableinline-edit-tablealert-managerbilling-pageproject-settingssegment-manageruser-exploreracquisition-analysisfunnel-analysisbreakdown-analysispath-analysiscohort-comparisondebug-workspaceuser-detailproject-overviewdata-explorerworkflow-run-historyDataTablecomposite-zonebuttoncheckbox
View test results

테스트 커버리지

2026년 7월 9일5/5 통과
5성공
0실패
5전체
  • grid role을 렌더링한다
  • 컬럼 헤더를 렌더링한다
  • 데이터 행을 렌더링한다
  • 빈 상태 메시지를 표시한다
  • onRowClick 핸들러를 호출한다

키보드 동작

키동작
↑ ↓행 탐색
← →셀 탐색
Enter / Space정렬 가능한 헤더 또는 행 활성화
리사이즈 핸들: ← →컬럼 너비를 10px 단위로 조절
리사이즈 핸들: Shift+← Shift+→컬럼 너비를 40px 단위로 조절
리사이즈 핸들: Home / End컬럼 너비를 최솟값/최댓값으로 이동

Blocks that use this component

opt-ui

AcquisitionAnalysis

Blocks

Analyze acquisition across Overview, Channels, and Campaigns tabs with metrics, trends, and tables.

opt-ui

AlertManager

Blocks

Manage alerts with a DataTable and AlertBuilder.

opt-ui

BillingPage

Blocks

Compose a billing overview from StatCard, BarChart, and DataTable.

opt-ui

BreakdownAnalysis

Blocks

Explore Trend, Distribution, Composition, and Data tabs with multiple charts and a DataTable.

opt-ui

CohortComparison

Blocks

Compare up to five cohorts across four tabs with comparison charts, retention heatmaps, and tables.

opt-ui

DataExplorer

Blocks

Explore filtered data with SearchCombobox, StatusSelect, and DataTable inside a group-spaced BlockLayout.

opt-ui

DebugWorkspace

Blocks

Debug E2E tests with a test-list sidebar and tabs for video, screenshots, network, console, and traces.

opt-ui

FunnelAnalysis

Blocks

Define funnel steps and compare conversion, breakdowns, and trends with charts and tables.

opt-ui

PathAnalysis

Blocks

Configure user-path analysis and explore grid or Sankey flows, top paths, drop-off, patterns, entry and exit points, and dwell time.

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.

opt-ui

SegmentManager

Blocks

Manage segments with a DataTable and SegmentBuilder.

opt-ui

UserDetail

Blocks

Build user profiles with avatars, metrics, gauges, progress indicators, tables, and filters.

opt-ui

UserExplorer

Blocks

Explore user records with a DataTable and FilterBar.

opt-ui

WorkflowRunHistory

Blocks

Browse workflow runs with search and status filters, a DataTable, and tabbed detail dialogs.

Related components

opt-ui

TreeTable

Shells

Explore hierarchical rows with recursive rendering and expand and collapse controls.

opt-ui

InlineEditTable

Shells

Edit cells with a double click, confirm with Enter, and cancel with Escape.

opt-ui

DomainTable

Shells

Manage domain rows in a Composite grid with keyboard navigation.

opt-ui

QueryResultsTable

Shells

Explore windowed query results with typed headers, local sorting, resizable columns, row details, and explicit null, boolean, and object values.

opt-ui

WidgetGrid

Shells

Arrange draggable and resizable dashboard widgets with react-grid-layout.

opt-ui

KanbanBoard

Shells

Move cards between Kanban columns using HTML5 drag and drop.

PreviousDomainTableNextNotificationToast