Excel Splitting
retab-ui/excel-splitting-viewer-blockFreeBlock
One Excel workbook fanned out into several clean CSVs — each reconstructed table rendered in the viewer, with a sidebar listing every CSV the splitter emitted, the sheet it was carved from, and how it was reconstructed. Selecting one opens that CSV.
Install it
npx shadcn@latest add https://ui.retab.com/r/excel-splitting-viewer-block.jsonSource
1"use client";23import * as React from "react";4import { FileSpreadsheet, TableProperties } from "lucide-react";56import { cn } from "@/lib/utils";7import { CsvViewerDocument } from "@/components/ui/csv-viewer";8import {9 FileViewer,10 FileViewerContent,11 FileViewerControls,12 FileViewerHeader,13 FileViewerInset,14 FileViewerProvider,15 FileViewerSidebar,16 FileViewerSidebarContent,17 FileViewerSidebarTrigger,18 FileViewerTitle,19 FileViewerViewport,20} from "@/components/ui/file-viewer";21import { XlsxViewer } from "@/components/ui/xlsx-viewer";22import { SEGMENT_PALETTE } from "@/lib/segments";23import csvOutputs from "@/components/viewers/sample-data/excel-splitting.json";2425const WORKBOOK_ID = "workbook";26const WORKBOOK_NAME = "nvidia-financials-fy2024.xlsx";27const XLSX_URL = "/samples/nvidia-financials-fy2024.xlsx";2829const WORKBOOK_SOURCE = {30 kind: "url" as const,31 url: XLSX_URL,32 fileName: WORKBOOK_NAME,33};3435type CsvId = keyof typeof csvOutputs;3637/**38 * One CSV the Excel splitter emitted. `sheetLabel` is the workbook sheet it was39 * carved from; `enrichment` is the reconstruction step that turned that raw40 * sheet into a clean, partition-ready table. The CSV text itself lives in the41 * sample-data JSON, keyed by `id`.42 */43type CsvOutput = {44 id: CsvId;45 fileName: string;46 sheetLabel: string;47 enrichment: string;48};4950const CSV_OUTPUTS: CsvOutput[] = [51 {52 id: "income-statement",53 fileName: "income-statement.csv",54 sheetLabel: "Consolidated Statements of Income",55 enrichment: "Period columns flattened to one header",56 },57 {58 id: "comprehensive-income",59 fileName: "comprehensive-income.csv",60 sheetLabel: "Consolidated Statements of Comprehensive Income",61 enrichment: "Section banners kept as label rows",62 },63 {64 id: "balance-sheet",65 fileName: "balance-sheet.csv",66 sheetLabel: "Consolidated Balance Sheets",67 enrichment: "Merged title cell dropped",68 },69 {70 id: "shareholders-equity",71 fileName: "shareholders-equity.csv",72 sheetLabel: "Consolidated Statements of Shareholders' Equity",73 enrichment: "Equity-component matrix melted to columns",74 },75 {76 id: "cash-flows",77 fileName: "cash-flows.csv",78 sheetLabel: "Consolidated Statements of Cash Flows",79 enrichment: "Blank filler cells cleared",80 },81];8283// Stable {kind:"text"} source per CSV so selecting one swaps the document84// without re-creating the viewer resource on every render.85const CSV_SOURCE_BY_ID = new Map(86// … 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 |
