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/txt-splitting-viewer-block

Text Splitting

retab-ui/txt-splitting-viewer-block
FreeBlock

One plain-text batch file separated into several documents — each carved-out document rendered in the viewer, with a left sidebar listing the source file first, then every document the splitter emitted, its type, line count, and the boundary cue that detected it. Selecting one opens that document.

Install it

npx shadcn@latest add https://ui.retab.com/r/txt-splitting-viewer-block.json

Source

registry/new-york-v4/blocks/txt-splitting-viewer-block.tsxui.retab.com/r/txt-splitting-viewer-block.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import { FileText, WrapText } from "lucide-react";
5
6import { cn } from "@/lib/utils";
7import {
8 FileViewer,
9 FileViewerContent,
10 FileViewerControls,
11 FileViewerHeader,
12 FileViewerInset,
13 FileViewerProvider,
14 FileViewerSidebar,
15 FileViewerSidebarContent,
16 FileViewerSidebarTrigger,
17 FileViewerTitle,
18 FileViewerViewport,
19} from "@/components/ui/file-viewer";
20import { TextViewer } from "@/components/ui/text-viewer";
21import { SEGMENT_PALETTE } from "@/lib/segments";
22import txtOutputs from "@/components/viewers/sample-data/txt-splitting.json";
23
24const SOURCE_ID = "source";
25const SOURCE_NAME = "intake-batch.txt";
26const TEXT_URL = "/samples/intake-batch.txt";
27
28const SOURCE_SOURCE = {
29 kind: "url" as const,
30 url: TEXT_URL,
31 fileName: SOURCE_NAME,
32};
33
34type TxtId = keyof typeof txtOutputs;
35
36/**
37 * One document the text splitter carved out of the batch file. `kind` is the
38 * document type it was classified as; `detection` is the boundary cue that
39 * separated it from its neighbours. The document text itself lives in the
40 * sample-data JSON, keyed by `id`.
41 */
42type TxtOutput = {
43 id: TxtId;
44 fileName: string;
45 kind: string;
46 detection: string;
47};
48
49const TXT_OUTPUTS: TxtOutput[] = [
50 {
51 id: "cover-letter",
52 fileName: "cover-letter.txt",
53 kind: "Cover letter",
54 detection: "Salutation and signature block",
55 },
56 {
57 id: "invoice",
58 fileName: "invoice.txt",
59 kind: "Invoice",
60 detection: "Invoice number and line-item table",
61 },
62 {
63 id: "delivery-receipt",
64 fileName: "delivery-receipt.txt",
65 kind: "Delivery receipt",
66 detection: "Received-by header and gate pass",
67 },
68 {
69 id: "purchase-order",
70 fileName: "purchase-order.txt",
71 kind: "Purchase order",
72 detection: "PO number and not-to-exceed amount",
73 },
74];
75
76// Stable {kind:"text"} source per document so selecting one swaps the viewer
77// without re-creating the resource on every render.
78const TXT_SOURCE_BY_ID = new Map(
79 TXT_OUTPUTS.map((output) => [
80 output.id,
81 {
82 kind: "text" as const,
83 text: txtOutputs[output.id],
84 fileName: output.fileName,
85 },
86 ]),
87);
88
89function lineCount(id: TxtId) {
90 return txtOutputs[id].split("\n").length;
91}
92
93function outputColor(index: number) {
94 return SEGMENT_PALETTE[index % SEGMENT_PALETTE.length];
95}
96
97/**
98 * Text splitting block — one plain-text batch file separated into several
99// … truncated

What it pulls in

npm packages

  • lucide-react

Other registry items

  • @retab/file-viewer
  • @retab/text-viewer
  • @retab/segments

Files it writes

  • registry/new-york-v4/blocks/txt-splitting-viewer-block.tsx
  • components/viewers/sample-data/txt-splitting.json

Facts

Registry
retab-ui
Type
registry:block
Access
Free
Files written
2
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