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

DOCX Sources

retab-ui/docx-sources-block
FreeBlock

Values extracted from a Word document linked back to where they came from — hover to highlight the text and scroll to it.

Install it

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

Source

registry/new-york-v4/blocks/docx-sources-block.tsxui.retab.com/r/docx-sources-block.json
1"use client";
2
3import * as React from "react";
4
5import type { Source } from "@/lib/document-source";
6import {
7 sourceToDocxHighlight,
8 useDocxSourceTarget,
9} from "@/components/ui/docx-source";
10import { DocxViewer, type DocxViewerHandle } from "@/components/ui/docx-viewer";
11import {
12 FileViewer,
13 FileViewerContent,
14 FileViewerHeader,
15 FileViewerTitle,
16 FileViewerProvider,
17 FileViewerSidebar,
18 FileViewerSidebarContent,
19 FileViewerInset,
20 FileViewerControls,
21 FileViewerViewport,
22} from "@/components/ui/file-viewer";
23import { SegmentedDocumentProvider } from "@/components/ui/segmented-document-provider";
24import { useSegmentedSourceFieldLink } from "@/components/ui/source-field-link";
25import {
26 SourceFieldList,
27 type SourceField,
28} from "@/components/ui/source-field-list";
29import { createSourcesSegmentedDocumentModel } from "@/components/ui/source-segmented-document-model";
30import docxSample from "@/components/viewers/sample-data/docx-sources.json";
31
32const DOCX_URL = "/samples/quarterly-business-review.docx";
33const DOCX_SOURCE = {
34 kind: "url" as const,
35 url: DOCX_URL,
36 fileName: "quarterly-business-review.docx",
37};
38
39type DocxField = SourceField & { source: Source };
40
41/** A short locator hint per anchor kind, matching the other source blocks. */
42function hintFor(source: Source): string | undefined {
43 const a = source.anchor;
44 if (a.kind === "docx_text_span") return `¶ ${a.paragraph + 1}`;
45 if (a.kind === "docx_table_cell")
46 return `Table ${a.table + 1} · R${a.row + 1}C${a.column + 1}`;
47 return undefined;
48}
49
50const FIELDS = (docxSample as DocxField[]).map((field) => ({
51 ...field,
52 hint: hintFor(field.source),
53}));
54const FIELD_BY_KEY = new Map(FIELDS.map((field) => [field.key, field]));
55const SEGMENTED_DOCUMENT = createSourcesSegmentedDocumentModel(
56 FIELDS.map((field) => ({
57 id: field.key,
58 label: field.label,
59 source: field.source,
60 })),
61);
62
63/**
64 * DOCX sources block — values extracted from a Word document, linked to where
65 * they came from. Hovering a field highlights its text in the document and
66 * scrolls to it. Segmented source interaction owns preview/selection while the
67 * DOCX source adapter owns rendered-document target navigation.
68 */
69export function DocxSourcesBlock() {
70 const viewerRef = React.useRef<DocxViewerHandle>(null);
71
72 return (
73 <SegmentedDocumentProvider model={SEGMENTED_DOCUMENT}>
74 <DocxSourcesContent viewerRef={viewerRef} />
75 </SegmentedDocumentProvider>
76 );
77}
78
79// … truncated

What it pulls in

Other registry items

  • @retab/docx-viewer
  • @retab/docx-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/docx-sources-block.tsx
  • components/viewers/sample-data/docx-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
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
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
Disabled Dropzonedropzone-disabled-dropzoneretab-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