Sources Viewer
retab-ui/sources-viewer-blockFreeBlock
Every source-backed format in one viewer — PDF/image bbox sources use segmented-document anchors; text, CSV, Excel, and Word use segmented source links with format-specific target adapters.
Install it
npx shadcn@latest add https://ui.retab.com/r/sources-viewer-block.jsonSource
1"use client";23import * as React from "react";4import type { JSONSchema7 } from "json-schema";5import { useForm } from "react-hook-form";67import {8 extractionSourcesToSourceMap,9 type Source,10 type SourceMap,11} from "@/lib/document-source";12import { cn } from "@/lib/utils";13import {14 sourceToCsvCell,15 useCsvSourceTarget,16} from "@/components/ui/csv-source";17import {18 CsvViewerGrid,19 CsvViewerProvider,20 type CsvViewerHandle,21} from "@/components/ui/csv-viewer";22import {23 sourceToDocxHighlight,24 useDocxSourceTarget,25} from "@/components/ui/docx-source";26import {27 DocxViewerDocument,28 DocxViewerProvider,29 type DocxViewerHandle,30} from "@/components/ui/docx-viewer";31import {32 FileViewerContent,33 FileViewerHeader,34 FileViewerTitle,35 FileViewer,36 FileViewerProvider,37 FileViewerSidebar,38 FileViewerSidebarContent,39 FileViewerSidebarSection,40 FileViewerSidebarSectionContent,41 FileViewerSidebarSectionHeader,42 FileViewerSidebarSectionTitle,43 FileViewerSidebarTrigger,44 FileViewerInset,45 FileViewerControls,46 FileViewerViewport,47 type ViewerSource,48 useFileViewerResource,49} from "@/components/ui/file-viewer";50import {51 ImageViewerFrames,52 ImageViewerProvider,53 type ImageViewerHandle,54} from "@/components/ui/image-viewer";55import { PdfViewerPages, PdfViewerProvider } from "@/components/ui/pdf-viewer";56import {57 SegmentedDocumentProvider,58 useSegmentedDocumentViewport,59} from "@/components/ui/segmented-document-provider";60import { sourceMapToEvidenceModel } from "@/components/ui/source-evidence";61import {62 useSegmentedSourceFieldLink,63 type SegmentedSourceFieldLink,64 type SourceFieldLink,65} from "@/components/ui/source-field-link";66import { SourceIndicator } from "@/components/ui/source-indicator";67import { createSourcesSegmentedDocumentModel } from "@/components/ui/source-segmented-document-model";68import {69 useSegmentedImageSourceOverlay,70 useSegmentedImageViewerHandle,71 useSegmentedPdfSourceOverlay,72 useSegmentedPdfViewerHandle,73} from "@/components/ui/source-segmented-document-overlays";74import {75 sourceToTextHighlight,76 useTextSourceTarget,77} from "@/components/ui/text-source";78import {79 TextViewerDocument,80 TextViewerProvider,81 type TextViewerHandle,82} from "@/components/ui/text-viewer";83import {84 sourceToXlsxCell,85 useXlsxSourceTarget,86} from "@/components/ui/xlsx-source";87import {88 XlsxViewerProvider,89 XlsxViewerWorkbook,90 type XlsxViewerHandle,91} from "@/components/ui/xlsx-viewer";92// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from retab-ui
All 130 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Classify Consensusclassify-consensus-viewer-block | retab-ui | Blocks | Free | 1 dep · 4 files | |
| CSV Sourcescsv-sources-block | retab-ui | Blocks | Free | no deps · 2 files | |
| DOCX Sourcesdocx-sources-block | retab-ui | Blocks | Free | no deps · 2 files | |
| Avatar Image Slotdropzone-avatar-image-slot | retab-ui | Blocks | Free | 1 dep · 2 files | |
| Dropzonedropzone-block | retab-ui | Blocks | Free | 1 dep · 26 files | |
| Comparison Pairdropzone-comparison-pair-upload | retab-ui | Blocks | Free | 1 dep · 2 files | |
| Controlled Queuedropzone-controlled-queue | retab-ui | Blocks | Free | 1 dep · 2 files | |
| Custom Thumbnail Griddropzone-custom-thumbnail-grid | retab-ui | Blocks | Free | 1 dep · 2 files |
