@retab/react package.
DataComponent
Display and edit extracted data in form, table, or code view. Supports real-time streaming during extraction.Props
| Prop | Type | Default | Description |
|---|---|---|---|
extraction | Extraction | null | required | The extraction object to display |
onFieldPathChange | (fieldPath: string) => void | - | Callback when a field is focused (for source highlighting) |
extractionDisplayOptions | ExtractionDisplayOptions | - | Display configuration options |
continueButtonOptions | ContinueButtonOptions | - | Continue/review button configuration |
extractionStreamingOptions | ExtractionStreamingOptions | - | Streaming state options |
ExtractionDisplayOptions
| Option | Type | Default | Description |
|---|---|---|---|
view | "form" | "table" | "code" | "form" | Initial view mode |
allowEditing | boolean | false | Enable editing of prediction values |
showReasoning | boolean | false | Show AI reasoning fields |
showTabs | boolean | false | Show tabs to switch between views |
Example
DataComponent Example
FileComponent
Preview documents with PDF rendering, image zoom, and OCR source highlighting. Supports streaming state for real-time extraction display.Props
| Prop | Type | Default | Description |
|---|---|---|---|
extraction | Extraction | null | required | The extraction containing the file to display |
fieldPath | string | null | null | Currently focused field path (for source highlighting) |
extractionStreamingOptions | ExtractionStreamingOptions | - | Streaming state options |
Example
FileComponent Example
ExtractionsList
Browse and manage extractions with search, filtering, pagination, and thumbnails.Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | - | Title displayed in the list header |
onSelectExtraction | (extraction: Extraction) => void | - | Callback when an extraction is selected |
onNewExtractionClick | () => void | - | Callback when “new extraction” is clicked |
visibility | VisibilityOptions | - | Control which features are visible |
initialFilters | FilterType[] | [] | Initial filters to apply |
VisibilityOptions
| Option | Type | Default | Description |
|---|---|---|---|
search | boolean | true | Show search input |
displayPopover | boolean | true | Show display settings popover |
statusColumn | boolean | false | Show status column |
dateColumn | boolean | true | Show date column |
filters | boolean | false | Show filter controls |
metadataFilter | boolean | false | Show metadata filter option |
Example
ExtractionsList Example
ExtractionReviewer
Complete review interface that combines an extraction list, file preview, and data editor. Ideal for human-in-the-loop workflows.Props
| Prop | Type | Default | Description |
|---|---|---|---|
projectId | string | required | The project ID to filter extractions |
extractionId | string | - | Currently selected extraction ID |
onNavigate | (params: { extractionId?: string }) => void | required | Callback for navigation |
initialFilters | FilterType[] | [] | Initial filters to apply |
visibility | ExtractionReviewerVisibilityOptions | - | Control visibility of features |
defaultView | "form" | "table" | "code" | "form" | Default view mode |
ExtractionReviewerVisibilityOptions
| Option | Type | Default | Description |
|---|---|---|---|
search | boolean | false | Show search input |
metadataFilter | boolean | false | Show metadata filter option |
filterMenu | boolean | true | Show filter menu |
displayMenu | boolean | true | Show display settings menu |
exportMenu | boolean | true | Show export menu |
uploadButton | boolean | true | Show upload button |
extractionDisplayOptions | ExtractionDisplayOptions | - | Display options for the data viewer |
Example
ExtractionReviewer Example
ExtractionComponent
Side-by-side file preview and data display with resizable panels. Supports file upload and real-time streaming extraction.Props
| Prop | Type | Default | Description |
|---|---|---|---|
extractionId | string | - | The extraction ID to display |
projectId | string | - | The project ID |
isNewExtraction | boolean | false | Whether this is a new extraction (shows upload UI) |
extractionDisplayOptions | ExtractionDisplayOptions | - | Display options for the data viewer |
continueButtonOptions | ContinueButtonOptions | - | Continue button configuration |
ContinueButtonOptions
| Option | Type | Default | Description |
|---|---|---|---|
onClick | () => void | - | Callback when continue button is clicked |
label | string | "Continue" | Button label text |
Example
ExtractionComponent Example
UploadJobsList
Upload files and track processing jobs. Supports drag-and-drop, batch uploads, and progress tracking.Props
| Prop | Type | Default | Description |
|---|---|---|---|
metadata | Record<string, string> | - | Optional metadata to associate with uploads |
Example
UploadJobsList Example
Filter Types
Filters can be used withExtractionsList and ExtractionReviewer to control which extractions are displayed.
FilterType
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the filter |
field | "created_date" | "status" | "metadata" | Field to filter on |
operator | "after" | "before" | "within" | "is" | "is_not" | "contains" | Filter operator |
value | string | Date | Filter value |
endValue | Date | End date for “within” operator |
metadataKey | string | Key for metadata filters |
Example Filters
Filter Examples