BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/retab-ui/json-form-sources-block

JSON Form Sources

retab-ui/json-form-sources-block
FreeBlock

Extraction rendered as a JSON form beside the source PDF — hover a form field to highlight where its value came from through segmented-document state.

Install it

npx shadcn@latest add https://ui.retab.com/r/json-form-sources-block.json

Source

registry/new-york-v4/blocks/json-form-sources-block.tsxui.retab.com/r/json-form-sources-block.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import type { JSONSchema7 } from "json-schema";
5import { useForm } from "react-hook-form";
6
7import { extractionSourcesToSourceMap } from "@/lib/document-source";
8import {
9 FileViewer,
10 FileViewerContent,
11 FileViewerHeader,
12 FileViewerTitle,
13 FileViewerInset,
14 FileViewerProvider,
15 FileViewerSidebar,
16 FileViewerSidebarTrigger,
17 FileViewerControls,
18 FileViewerViewport,
19 type ViewerSource,
20 useFileViewerResource,
21} from "@/components/ui/file-viewer";
22import {
23 ImageViewerFrames,
24 ImageViewerProvider,
25 type ImageViewerHandle,
26} from "@/components/ui/image-viewer";
27import { PdfViewerPages, PdfViewerProvider } from "@/components/ui/pdf-viewer";
28import { ScrollArea } from "@/components/ui/scroll-area";
29import {
30 SegmentedDocumentProvider,
31 useSegmentedDocumentViewport,
32} from "@/components/ui/segmented-document-provider";
33import { sourceMapToEvidenceModel } from "@/components/ui/source-evidence";
34import { useSegmentedSourceFieldLink } from "@/components/ui/source-field-link";
35import { SourceIndicator } from "@/components/ui/source-indicator";
36import { createSourcesSegmentedDocumentModel } from "@/components/ui/source-segmented-document-model";
37import {
38 useSegmentedImageSourceOverlay,
39 useSegmentedImageViewerHandle,
40 useSegmentedPdfSourceOverlay,
41 useSegmentedPdfViewerHandle,
42} from "@/components/ui/source-segmented-document-overlays";
43import { JsonForm } from "@/components/json-form/json-form";
44import sourcesSample from "@/components/viewers/sample-data/json-form-sources.json";
45
46const PDF_URL = "/samples/jane-doe-bank-statement-5-pages.pdf";
47const PDF_SOURCE = {
48 kind: "url" as const,
49 url: PDF_URL,
50 fileName: "jane-doe-bank-statement-5-pages.pdf",
51};
52const JSON_FORM_SOURCES_DEFAULT_OPEN_PATHS = ["transactions"] as const;
53
54// An extraction of the bank-statement sample shaped like the
55// `GET /v1/extractions/{id}/sources` response: a JSON Schema, the extracted
56// values, and a parallel `sources` tree (leaves `{ value, source }`).
57const SAMPLE_SCHEMA = sourcesSample.schema as JSONSchema7;
58const SAMPLE_EXTRACTION = sourcesSample.extraction as Record<string, unknown>;
59const SAMPLE_SOURCES = sourcesSample.sources;
60
61export type JsonFormSourcesBlockProps = {
62 defaultOpenPaths?: readonly string[];
63 documentKind?: "pdf" | "image";
64 extraction?: Record<string, unknown>;
65 fallbackFrameSize?: { width: number; height: number };
66 schema?: JSONSchema7;
67 source?: ViewerSource;
68 sources?: unknown;
69};
70
71// … truncated

What it pulls in

npm packages

  • react-hook-form
  • @radix-ui/react-checkbox@^1.1.3
  • @radix-ui/react-label@^2.1.1
  • @radix-ui/react-slot@^1.1.1
  • lucide-react@^0.460.0

Other registry items

  • @retab/file-viewer
  • @retab/pdf-viewer
  • @retab/document-source
  • @retab/scroll-area
  • @retab/segmented-document
  • @retab/source-evidence
  • @retab/source-segmented-document
  • @retab/source-field-link
  • @retab/source-indicator
  • @retab/data-cell
  • @retab/input
  • tooltip

Files it writes

  • registry/new-york-v4/blocks/json-form-sources-block.tsx
  • components/viewers/sample-data/json-form-sources.json
  • components/json-form/array-fields.tsx
  • components/json-form/disclosure.tsx
  • components/json-form/field-renderer.ts
  • components/json-form/form-primitives.tsx
  • components/json-form/json-form-constants.ts
  • components/json-form/json-form.tsx
  • components/json-form/object-fields.tsx
  • components/json-form/open-paths.tsx
  • components/json-form/path-codec.ts
  • components/json-form/scalar-control.tsx
  • components/json-form/scalar/boolean-control.tsx
  • components/json-form/scalar/date-time-control.tsx
  • components/json-form/scalar/enum-control.tsx
  • components/json-form/scalar/number-control.tsx
  • components/json-form/scalar/text-control.tsx
  • components/json-form/scalar/types.ts
  • components/json-form/schema-model.ts
  • components/json-form/source-link-table-hover.ts
  • components/json-form/source-link.tsx
  • components/json-form/table/array-table-body.tsx
  • components/json-form/table/array-table-cell-commit.ts
  • components/json-form/table/array-table-cell-model.ts
  • components/json-form/table/array-table-cell-props.ts
  • components/json-form/table/array-table-cell.tsx
  • components/json-form/table/array-table-config.ts
  • components/json-form/table/array-table-format.ts
  • components/json-form/table/array-table-row.tsx
  • components/json-form/table/array-table-scroll.ts
  • components/json-form/table/array-table.tsx
  • components/json-form/virtual-list.tsx
  • registry/new-york-v4/ui/measured-row-virtualization.ts
  • components/json-form/table/array-table-active-cell-store.ts
  • components/json-form/table/array-table-data-cell-props.ts
  • components/json-form/source-link-focus-intent.ts

Facts

Registry
retab-ui
Type
registry:block
Access
Free
Files written
36
Licence
NOASSERTION
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

ui.retab.com retab-dev/retab-ui on GitHub Raw registry item This item as JSON

More from retab-ui

All 130 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Classify Consensusclassify-consensus-viewer-blockretab-uiBlocksFree1 dep · 4 files
CSV Sourcescsv-sources-blockretab-uiBlocksFreeno deps · 2 files
DOCX Sourcesdocx-sources-blockretab-uiBlocksFreeno deps · 2 files
Avatar Image Slotdropzone-avatar-image-slotretab-uiBlocksFree1 dep · 2 files
Dropzonedropzone-blockretab-uiBlocksFree1 dep · 26 files
Comparison Pairdropzone-comparison-pair-uploadretab-uiBlocksFree1 dep · 2 files
Controlled Queuedropzone-controlled-queueretab-uiBlocksFree1 dep · 2 files
Custom Thumbnail Griddropzone-custom-thumbnail-gridretab-uiBlocksFree1 dep · 2 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex