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/text-sources-block

Text Sources

retab-ui/text-sources-block
FreeBlock

Values extracted from a log file linked to the lines they came from — hover to highlight a line range.

Install it

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

Source

registry/new-york-v4/blocks/text-sources-block.tsxui.retab.com/r/text-sources-block.json
1"use client";
2
3import * as React from "react";
4
5import type { Source } from "@/lib/document-source";
6import {
7 FileViewer,
8 FileViewerContent,
9 FileViewerHeader,
10 FileViewerTitle,
11 FileViewerProvider,
12 FileViewerSidebar,
13 FileViewerSidebarContent,
14 FileViewerInset,
15 FileViewerControls,
16 FileViewerViewport,
17} from "@/components/ui/file-viewer";
18import { SegmentedDocumentProvider } from "@/components/ui/segmented-document-provider";
19import { useSegmentedSourceFieldLink } from "@/components/ui/source-field-link";
20import {
21 SourceFieldList,
22 type SourceField,
23} from "@/components/ui/source-field-list";
24import { createSourcesSegmentedDocumentModel } from "@/components/ui/source-segmented-document-model";
25import {
26 sourceToTextHighlight,
27 useTextSourceTarget,
28} from "@/components/ui/text-source";
29import { TextViewer, type TextViewerHandle } from "@/components/ui/text-viewer";
30import textSample from "@/components/viewers/sample-data/text-sources.json";
31
32const TEXT_URL = "/samples/extraction-run.log";
33const TEXT_SOURCE = {
34 kind: "url" as const,
35 url: TEXT_URL,
36 fileName: "extraction-run.log",
37};
38
39type TextField = SourceField & { source: Source };
40
41const FIELDS = (textSample as TextField[]).map((field) => ({
42 ...field,
43 hint:
44 field.source.anchor.kind === "text_span"
45 ? `Line ${field.source.anchor.line_start}`
46 : undefined,
47}));
48const FIELD_BY_KEY = new Map(FIELDS.map((field) => [field.key, field]));
49const SEGMENTED_DOCUMENT = createSourcesSegmentedDocumentModel(
50 FIELDS.map((field) => ({
51 id: field.key,
52 label: field.label,
53 source: field.source,
54 })),
55);
56
57/**
58 * Text sources block — values extracted from a log file, linked to the lines
59 * they came from. Hovering a field highlights its line range and scrolls to it.
60 * Segmented source interaction owns field preview/selection while the text
61 * source adapter owns line-range scrolling and highlighting.
62 */
63export function TextSourcesBlock() {
64 const viewerRef = React.useRef<TextViewerHandle>(null);
65
66 return (
67 <SegmentedDocumentProvider model={SEGMENTED_DOCUMENT}>
68 <TextSourcesContent viewerRef={viewerRef} />
69 </SegmentedDocumentProvider>
70 );
71}
72
73function TextSourcesContent({
74 viewerRef,
75}: {
76 viewerRef: React.RefObject<TextViewerHandle | null>;
77}) {
78 const target = useTextSourceTarget(viewerRef);
79 const segmentedLink = useSegmentedSourceFieldLink({
80 initialSourcePath: FIELDS[0]?.key,
81 });
82 const link = useTargetedSourceFieldLink({
83// … truncated

What it pulls in

Other registry items

  • @retab/text-viewer
  • @retab/text-source
  • @retab/document-source
  • @retab/segmented-document
  • @retab/source-segmented-document
  • @retab/source-field-list
  • @retab/source-field-link
  • @retab/source-indicator

Files it writes

  • registry/new-york-v4/blocks/text-sources-block.tsx
  • components/viewers/sample-data/text-sources.json

Facts

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

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