TidalUI

CSV preview preview

Inspect parsed rows and field-level validation messages before an import.

pro · Data · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/csv-preview

Import components/ui/tidal.css, components/ui/csv-preview.css. Wrap installed components in tidal-scope.

Preview

CSV preview component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/csv-preview.css";
import{TidalCsvPreview}from"./components/ui/csv-preview";
export default()=><div className="tidal-scope"><TidalCsvPreview columns={[{id:"example",label:"Demo"}]} rows={[{id:"example",rowNumber:"value",cells:{}}]}/></div>;

API and props

TidalCsvPreview.columns (required)
ReadonlyArray<TidalCsvColumn>

Required columns value accepted by this exported component.

TidalCsvPreview.rows (required)
ReadonlyArray<TidalCsvRow>

Required rows value accepted by this exported component.

TidalCsvPreview.allButtonProps
OwnedButtonProps | undefined

Optional all button props value accepted by this exported component.

TidalCsvPreview.description
ReactNode

Optional description value accepted by this exported component.

TidalCsvPreview.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalCsvPreview.exportButtonProps
OwnedButtonProps | undefined

Optional export button props value accepted by this exported component.

TidalCsvPreview.exportButtonRef
Ref<HTMLButtonElement> | undefined

Optional export button ref value accepted by this exported component.

TidalCsvPreview.fileName
ReactNode

Optional file name value accepted by this exported component.

TidalCsvPreview.headingLevel
2 | 3 | 4 | 5 | 6 | undefined

Optional heading level value accepted by this exported component.

TidalCsvPreview.issuesButtonProps
OwnedButtonProps | undefined

Optional issues button props value accepted by this exported component.

TidalCsvPreview.labels
Partial<{ all: string; issues: string; export: string; exporting: string; row: string; empty: string; noIssues: string; missing: string; valid: string; errors: string; warnings: string; invalid: string; unavailableTotal: string; table: string; validation: string; }> | undefined

Optional labels value accepted by this exported component.

TidalCsvPreview.onExportIssues
((rows: readonly TidalCsvRow[], event: MouseEvent<HTMLButtonElement>) => void) | undefined

Callback invoked when the export issues interaction is proposed.

TidalCsvPreview.onViewChange
((view: TidalCsvView, event: MouseEvent<HTMLButtonElement>) => void) | undefined

Callback invoked when the view change interaction is proposed.

TidalCsvPreview.pending
boolean | undefined

Optional pending value accepted by this exported component.

TidalCsvPreview.summary
((shown: number, supplied: number, total: number | undefined) => ReactNode) | undefined

Optional summary value accepted by this exported component.

TidalCsvPreview.title
ReactNode

Optional title value accepted by this exported component.

TidalCsvPreview.totalRows
number | undefined

Optional total rows value accepted by this exported component.

TidalCsvPreview.view
TidalCsvView | undefined

Optional view value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas