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
- 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.
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
Next Steps
Widgets Reference
Detailed documentation for each component with props and examples.
Hooks Reference
React hooks for accessing Retab context and data.
Next.js Quickstart
Step-by-step guide to integrate widgets in a Next.js application.