
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@piyushnagar/react-spreadsheet-grid
Advanced tools
A powerful, reusable spreadsheet component built with React and TypeScript. Features Excel-like functionality including cell editing, drag-and-drop, filtering, and multiple data types.
A powerful, reusable spreadsheet component built with React and TypeScript. Features Excel-like functionality including cell editing, drag-and-drop, filtering, and multiple data types.
npm install
npm run dev
import SpreadsheetGrid from './components/SpreadsheetGrid/SpreadsheetGrid';
import { SpreadsheetData } from './types/spreadsheet';
// Basic usage with default data
function App() {
return (
<div style={{ height: '400px' }}>
<SpreadsheetGrid />
</div>
);
}
import { useState } from 'react';
import SpreadsheetGrid from './components/SpreadsheetGrid/SpreadsheetGrid';
import { SpreadsheetData } from './types/spreadsheet';
function CustomSpreadsheet() {
const [data, setData] = useState<SpreadsheetData>({
columns: [
{ id: 'name', header: 'Name', type: 'string' },
{ id: 'age', header: 'Age', type: 'number' },
{ id: 'active', header: 'Active', type: 'boolean' },
{ id: 'joinDate', header: 'Join Date', type: 'date' },
{ id: 'skills', header: 'Skills', type: 'list' }
],
rows: [
{
name: 'John Doe',
age: 30,
active: true,
joinDate: '2023-01-15',
skills: 'JavaScript'
}
]
});
const handleDataChange = (newData: SpreadsheetData) => {
setData(newData);
// Save to database, localStorage, etc.
};
return (
<div style={{ height: '500px' }}>
<SpreadsheetGrid
data={data}
onDataChange={handleDataChange}
initialRows={25}
initialCols={10}
showControls={true}
height="100%"
/>
</div>
);
}
function MinimalSpreadsheet() {
const minimalData = {
columns: [
{ id: 'task', header: 'Task', type: 'string' },
{ id: 'completed', header: 'Done', type: 'boolean' }
],
rows: [
{ task: 'Learn React', completed: true },
{ task: 'Build Spreadsheet', completed: false }
]
};
return (
<SpreadsheetGrid
data={minimalData}
showControls={false}
initialRows={10}
initialCols={5}
className="custom-spreadsheet"
/>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
data | SpreadsheetData | undefined | Initial data structure |
initialRows | number | 50 | Number of rows to create |
initialCols | number | 20 | Number of columns to create |
onDataChange | (data: SpreadsheetData) => void | undefined | Callback when data changes |
showControls | boolean | true | Show add row/column buttons |
height | string | "100%" | Container height |
className | string | "" | Additional CSS classes |
interface SpreadsheetData {
columns: Column[];
rows: Record<string, any>[];
}
interface Column {
id: string; // Unique identifier
header: string; // Display name
type: ColumnType; // Data type
width?: number; // Column width (optional)
}
The component uses CSS modules and can be customized with:
.custom-spreadsheet {
border: 2px solid #e2e8f0;
border-radius: 8px;
}
.custom-spreadsheet .cell {
font-size: 14px;
}
.custom-spreadsheet .column-header {
background-color: #f8fafc;
font-weight: 600;
}
Check out the src/examples/ExampleComponent.tsx file for comprehensive examples including:
MIT License - see LICENSE file for details
FAQs
A powerful, reusable spreadsheet component built with React and TypeScript. Features Excel-like functionality including cell editing, drag-and-drop, filtering, and multiple data types.
The npm package @piyushnagar/react-spreadsheet-grid receives a total of 1 weekly downloads. As such, @piyushnagar/react-spreadsheet-grid popularity was classified as not popular.
We found that @piyushnagar/react-spreadsheet-grid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.