Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
React spreadsheet libraries embed an editable grid of cells, with sheets, formulas, and cell editors, in a React app. A spreadsheet component either renders every cell or virtualizes the grid to draw only the visible region. These libraries let business apps and internal tools offer spreadsheet editing inside their own interface.
Popularity
AG Grid has the most monthly downloads in this comparison, at 15.3M, a count that covers all its data grid work.
export function TasksClientPage({ initialTasks }: TasksClientPageProps) {
const router = useRouter();
const [isCreateTaskDialogOpen, setIsCreateTaskDialogOpen] = useState(false);
const initialGridData: TasksPageGridData[] = useMemo(() => {
return initialTasks.map(task => ({
id: task.id || simpleUUID(),
name: task.name ?? null,
description: task.description ?? null,
frequency: task.frequency ?? null, // Adapt if type is not string/nullable
department: task.department ?? null, // Adapt if type is not string/nullable
createdAt: task.createdAt ? new Date(task.createdAt) : null,
updatedAt: task.updatedAt ? new Date(task.updatedAt) : null,
}));
}, [initialTasks]);
const {
dataForGrid,
handleGridChange,
getRowClassName,
handleCommit,
handleCancel,
isDirty,
changesSummaryString
} = useTaskChangeTracking(initialGridData);
// Log isDirty value on every render of TasksClientPage // console.log('[TasksClientPage] isDirty value:', isDirty, 'changesSummaryString:', changesSummaryString); const {
searchTerm,
setSearchTerm,
sortColumnKey,
setSortColumnKey,
sortDirection,
toggleSortDirection,
processedData: sortedDataWithPotentialTimestamps,
} = useTableSearchSort<TasksPageGridData, keyof TasksPageGridData>(
dataForGrid, // Use dataForGrid from useTaskChangeTracking
tasksSearchableKeys,
tasksSortConfig,
'createdAt', // Default sort column
'asc' // Default sort direction
);
// Convert timestamps back to Date objects if useTableSearchSort changed them const dataForDisplay = useMemo(() => {
return sortedDataWithPotentialTimestamps.map(row => {
const newRow = { ...row };
if (typeof newRow.createdAt === 'number') {
newRow.createdAt = new Date(newRow.createdAt);
}
if (typeof newRow.updatedAt === 'number') {
newRow.updatedAt = new Date(newRow.updatedAt);
}
return newRow;
});
}, [sortedDataWithPotentialTimestamps]);
// Define columns for DataSheetGrid const columns: Column<TasksPageGridData>[] = [
{ ...keyColumn('name', textColumn), title: 'Name', minWidth: 250 },
{ ...keyColumn('description', textColumn), title: 'Description', minWidth: 350, grow: 1 },
{ ...keyColumn('frequency', textColumn), title: 'Frequency', minWidth: 150 }, // Adjust if using a select/enum column
{ ...keyColumn('department', textColumn), title: 'Department', minWidth: 150 }, // Adjust if using a select/enum column
{ ...keyColumn('createdAt', friendlyDateColumnBase), title: 'Created At', minWidth: 220, disabled: true },
{ ...keyColumn('updatedAt', friendlyDateColumnBase), title: 'Updated At', minWidth: 220, disabled: true },
{ ...keyColumn('id', textColumn as Partial<Column<string, any, string>>), title: 'ID', minWidth: 280, disabled: true },
];
const handleCreateTaskSuccess = () => {
setIsCreateTaskDialogOpen(false);
toast.success("Task created successfully!");
// Refresh data or optimistically update. For now, router.refresh() is simplest. router.refresh();
};
return (
<>
<PageLayout breadcrumbs={[{ label: "Tasks", href: "/tasks" }]}>
{/* Simplified debug display for isDirty - To be removed */}
{/* <div style={{ padding: '10px', backgroundColor: isDirty ? 'lightgreen' : 'lightcoral' }}>
Is Dirty: {isDirty ? 'Yes' : 'No'} - Summary: {changesSummaryString}
</div> */}
{isDirty && (
<div className="flex items-center space-x-2 mb-4 p-2 bg-secondary/80 rounded-sm">
<span className="text-sm text-muted-foreground">{changesSummaryString}</span>
<Button variant="outline" onClick={async () => {
handleCancel();
// Potentially add router.refresh() if canceling discards optimistic UI updates from creations via dialog }} size="sm" className="rounded-sm">
Cancel
</Button>
<Button onClick={async () => {
const result = await handleCommit();
if (result.needsRefresh) {
router.refresh(); // Refresh data from server after commit
}
}} size="sm" className="rounded-sm">
Commit Changes
</Button>
</div>
)}
<TableToolbar
searchTerm={searchTerm}
onSearchTermChange={setSearchTerm}
sortableColumnOptions={sortableColumnsOptions}
sortColumnKey={sortColumnKey}
onSortColumnKeyChange={(key) => setSortColumnKey(key as keyof TasksPageGridData | null)}
sortDirection={sortDirection}
onSortDirectionChange={toggleSortDirection}
>
<Button onClick={() => setIsCreateTaskDialogOpen(true)} className="ml-2 h-9 rounded-sm">
Create Task
</Button>
</TableToolbar>
<div className="mt-4">
<DataSheetGrid
value={dataForDisplay} // Use the fully processed data
height={600} // Adjust as needed
onChange={handleGridChange}
columns={columns}
rowClassName={getRowClassName}
createRow={() => ({ // Default structure for new rows created directly in grid
id: simpleUUID(),
name: 'New Task Name',
description: 'Task Description',
frequency: null, // Or a default enum value
department: null, // Or a default enum value
createdAt: new Date(),
updatedAt: new Date(),
})}
duplicateRow={({rowData}) => ({
...rowData,
id: simpleUUID(),
name: rowData.name ? `Copy of ${rowData.name}` : 'Copied Task',
createdAt: new Date(),
updatedAt: new Date(),
})}
/>
</div>
</PageLayout>
<CreateTaskDialog
isOpen={isCreateTaskDialogOpen}
onOpenChange={setIsCreateTaskDialogOpen}
onTaskCreated={handleCreateTaskSuccess} // Use the new handler
// createTaskAction={createTaskTemplate} // Pass the server action />
</>
);
}
FAQ
FortuneSheet suits embedded workbooks with sheets and formulas. React Spreadsheet suits small controlled grids with custom cell viewers and editors. react-datasheet-grid suits editing row arrays in a virtualized grid.
AG Grid provides the React component for the AG Grid data grid.
No. Grids that must leave offscreen rows unrendered need a virtualized alternative such as react-datasheet-grid.
Through its import and export plugin. FortuneSheet needs that plugin to exchange XLSX files.
For coding agents
Found your spreadsheet library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.