What are Retab Widgets?
Retab Widgets (@retab/react) is a React component library that provides drop-in UI components for document extraction workflows. Instead of building extraction interfaces from scratch, you can use pre-built, customizable components that handle:
- Document viewing - PDF rendering, image zoom, field highlighting
- Data display - Form, table, and code views for extracted data
- Human-in-the-loop review - Complete interfaces for reviewing and editing extractions
- File uploads - Drag-and-drop uploading with progress tracking
Key Features
Drop-in Components
Pre-built UI components that work out of the box with minimal configuration.
Real-time Streaming
Watch extractions populate in real-time as the AI processes your documents.
Human Review
Built-in support for human-in-the-loop workflows with draft editing and approval flows.
Customizable
Control visibility, behavior, and styling to match your application’s needs.
Installation
Install the package using your preferred package manager:layout.tsx
Architecture
The widget library uses a provider pattern. Wrap your application (or the portion that needs Retab functionality) withRetabProvider:
providers.tsx
- Authentication - Token management and API requests
- Project context - Loading project configuration and JSON schema
- Extractions state - Managing extraction lists and selection
- OCR context - Field location detection for source highlighting
Available Components
| Component | Description |
|---|---|
DataComponent | Display and edit extracted data in form, table, or code view |
FileComponent | Preview documents with PDF rendering, image zoom, and field highlighting |
ExtractionsList | Browse extractions with search, filters, and pagination |
ExtractionReviewer | Complete review interface combining list, file preview, and data editor |
ExtractionComponent | Side-by-side file preview and data display with resizable panels |
UploadJobsList | Upload files and track processing jobs |