TidalUI

Data grid preview

Edit and select consumer-owned records with contained spreadsheet keyboard movement.

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/data-grid

Import components/ui/tidal.css, components/ui/data-grid.css. Wrap installed components in tidal-scope.

Preview

Data grid component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/data-grid.css";
import{TidalDataGrid}from"./components/ui/data-grid";
export default(p:Parameters<typeof TidalDataGrid>[0])=><div className="tidal-scope"><TidalDataGrid {...p}/></div>;

API and props

TidalDataGrid.activeCell (required)
TidalDataGridCell | null

Required active cell value accepted by this exported component.

TidalDataGrid.caption (required)
string

Required caption value accepted by this exported component.

TidalDataGrid.columns (required)
ReadonlyArray<TidalDataGridColumn<T>>

Required columns value accepted by this exported component.

TidalDataGrid.editingCell (required)
TidalDataGridCell | null

Required editing cell value accepted by this exported component.

TidalDataGrid.editValue (required)
string

Required edit value value accepted by this exported component.

TidalDataGrid.getRowId (required)
(row: T) => string

Required get row id value accepted by this exported component.

TidalDataGrid.getRowLabel (required)
(row: T) => string

Required get row label value accepted by this exported component.

TidalDataGrid.onActiveCellChange (required)
(cell: TidalDataGridCell, event: SyntheticEvent<HTMLElement>) => void

Callback invoked when the active cell change interaction is proposed.

TidalDataGrid.onCellCommit (required)
(cell: TidalDataGridCell, value: string, event: FormEvent<HTMLFormElement>) => void

Callback invoked when the cell commit interaction is proposed.

TidalDataGrid.onEditingCellChange (required)
(cell: TidalDataGridCell | null, event: SyntheticEvent<HTMLElement>) => void

Callback invoked when the editing cell change interaction is proposed.

TidalDataGrid.onEditValueChange (required)
(value: string, event: ChangeEvent<HTMLInputElement>) => void

Callback invoked when the edit value change interaction is proposed.

TidalDataGrid.rows (required)
ReadonlyArray<T>

Required rows value accepted by this exported component.

TidalDataGrid.cancelButtonProps
Omit<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "type" | "aria-disabled" | OwnedMarkup> | undefined

Optional cancel button props value accepted by this exported component.

TidalDataGrid.cancelButtonRef
Ref<HTMLButtonElement> | undefined

Optional cancel button ref value accepted by this exported component.

TidalDataGrid.description
ReactNode

Optional description value accepted by this exported component.

TidalDataGrid.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalDataGrid.labels
Partial<TidalDataGridLabels> | undefined

Optional labels value accepted by this exported component.

TidalDataGrid.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalDataGrid.saveButtonProps
Omit<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "type" | "aria-disabled" | OwnedMarkup> | undefined

Optional save button props value accepted by this exported component.

TidalDataGrid.saveButtonRef
Ref<HTMLButtonElement> | undefined

Optional save button ref value accepted by this exported component.

TidalDataGrid.selection
TidalDataGridSelection<T> | undefined

Optional selection value accepted by this exported component.

TidalDataGrid.tableProps
Omit<TableHTMLAttributes<HTMLTableElement>, "role" | "aria-colcount" | "aria-rowcount" | OwnedMarkup> | undefined

Optional table props value accepted by this exported component.

TidalDataGrid.tableRef
Ref<HTMLTableElement> | undefined

Optional table ref value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas