WingoUI
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime Picker
Forms
Address InputCSV ImportFieldForm WizardInline EditInvoice line itemsRich Text EditorSchema Builder
Navigation
Back To TopBounce SidebarBreadcrumbCommand MenuGlobal SearchGooey NavHook SidebarNav MenuNav TabsPaginationProximity SidebarScroll ProgressSidebarStepsTable Of ContentsTabsTopbarUser MenuWorkspace Switcher
Overlays
Alert DialogContext MenuDialogDrawerDropdown MenuFamily DrawerHover CardPopoverSheetShortcuts DialogTooltipTour
Feedback
AlertBannerCookie ConsentEmoji ReactionEmpty StateNotification BellNotification CenterProgressRoute ProgressSkeletonSpinnerToast
Data Display
Approval FlowAvatarBadgeCalendar ViewCode BlockComment ThreadContact cardCountdownDescription ListDiff ViewerFile ListFile managerFolderGanttJSON ViewerKbdLog ViewerMarkdownPresenceSchedulerTagTimelineTree View
Tables & Lists
Audit LogData TableDeal PipelineEditable GridKanbanListMembers tablePermissions MatrixTableTask ListVirtual List
Charts & Stats
Animated CounterArea chartBar chartDonut chartFunnel chartGaugeGitHub ActivityHeatmap calendarLeaderboardLine chartRadial barSparklineStat CardTrackerTrend badge
Layout
AccordionApp ShellCardCollapsibleDetail LayoutEntity HeaderPage HeaderScroll AreaSeparatorSettings LayoutSplit ViewToolbar
Media
Audio PlayerCarouselCSV ViewerDOCX ViewerExcel ViewerFile SystemImage CropperImage LightboxLocation MapPDF ViewerPowerPoint ViewerQR CodeStep PlayerVideo Player
AI Kit
Agent Status CardChat MessageChat ThreadConversation ListFluid OrbGrid RevealMatrix OrbModel PickerPrompt InputReasoning IndicatorRule BuilderSuggestion ChipsTool Call TimelineUsage MeterVoice InputWorkflow Canvas
Text & Effects
Gravity Letters
Mobile
Action SheetBottom Tab BarFABHaptic ButtonHero HeaderInstall PromptLarge Title HeaderNotification BannerOnboarding CarouselPicker WheelPull To RefreshSlide To ConfirmSticky CTA BarSwipe DeckSwipeable Tabs
Commerce
Cart drawerCategory pickerCheckout stepsCoupon inputFavorite buttonFilter panelListing cardListing gridOrder trackerPricePrice rangePricing tableProduct galleryQuantity stepperReviewsSeller card
Blocks
Admin Dashboard PageAdmin ShellAI Chat PageAutomation Builder PageCheckout PageCRM Contact PageCRM Pipeline PageError PagesInbox PageInvoice PageKPI DashboardListing Detail PageLogin PageMarketplace Home PageMarketplace Search PageMarketplace ShellMobile App HomeOnboarding FlowPost Listing WizardPricing PageRegister PageSettings PageUsers Admin Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryTheme

Media

CSV Viewer

MediaCSV ViewerNew
CarouselDOCX Viewer
Live props
Content
src
data
fileName
delimiter
encoding
header
Behavior
defaultZoom1
defaultWrapText
defaultRowNumbers
defaultFormatValues
defaultFrozenColumns0
sortable
filterable
resizable
maxFileSize104857600B
maxRows1000000
locale
Appearance
variant
radius
selectionColor
highlightColor
activeHighlightColor
Layout
showToolbar
showDetailBar
showStatusBar
showSearch
showViewSwitches
showColumnsMenu
showDownload
showUpload
height640px
Code
import { CsvViewer } from "@/components/ui/csv-viewer"

<CsvViewer />
ProNew

v1.0.0·Added in 1.4.0

A CSV and TSV viewer for large files: typed columns, sort, filters, search, selection with copy, resizable and frozen columns, zoom.

The file is read in the browser in small slices, so the first rows show while a big file is still loading and the page never freezes; only the rows and columns in view are drawn, so 200,000 rows scroll smoothly. The delimiter (comma, semicolon, tab or pipe), the text encoding (UTF-8 with or without BOM, UTF-16, Windows-1252) and the header row are detected; change any of them from the status bar or the ⋯ menu. Columns without a header are named A, B, C. Numbers, dates and true / false columns are recognized: numbers align right, numbers and dates are formatted for the locale, sorting follows the type and copies keep the original values. Click a cell, Shift+click or drag for a range, click a column header or a row number for a whole column or row; on touch, tap a cell. The keyboard works like a spreadsheet's: arrows, Tab, Enter, Home / End, Page Up / Down, Ctrl / ⌘ + arrows jump to the edge of the data, Shift extends, Ctrl / ⌘ + A selects all, Ctrl / ⌘ + C copies as tab separated text, Alt + drag selects text inside cells. The bar above the grid shows the address and the full value of the active cell (type an address like C120 and press Enter to go there). Each column header opens a panel (Alt+Down) to sort, filter by text or by a list of its values, fit the width, freeze the columns up to it, hide it or copy it; drag a header edge to resize, double-click it to fit. Search opens from the toolbar or with Ctrl+F / ⌘F inside the viewer: the counter reads 2 of 6 and Enter / Shift+Enter jump between hits. The status bar counts rows and columns, shows how many rows a filter keeps, and the sum, average and count of a selected range. The toolbar zooms, turns the header row, wrapped text, row numbers and formatting on or off, shows or hides columns and downloads the file; below 720px of width these move into the ⋯ menu, which also opens another file (or drop one onto the viewer). Pinch with two fingers, or Ctrl / ⌘ + scroll, to zoom around that point. Menus and panels become bottom sheets on phones.

Add to a project

npx wingo-ui@latest add csv-viewer

Pro item: the CLI needs a Pro account. See plans

Dependencies

@tanstack/react-virtuallucide-reactbuttoncheckboxdropdown-menupopovertooltipuse-media-queryui-config

Files

  • components/ui/csv-viewer.tsx

See also

Excel ViewerCSV ImportData TableSpreadsheetlibPDF Viewer
PreviousCarouselNext DOCX Viewer
Loading file