A reactive, lightweight spreadsheet web application built with Vue 3, Vite, and Pinia. This project replicates the fundamental behavior of Google Sheets and Microsoft Excel, including coordinate indexing, dynamic formula computation, reactive cell dependency graphs, automatic grid expansion, and copy-paste compatibility with external spreadsheets.
-
📊 Dynamic Spreadsheet Grid:
- Excel-style alphanumeric coordinate system (
A,B, ...Z,AA,AB, ...). - Starts with an initial 26 columns × 50 rows grid.
- Built-in safety boundary protecting performance (maximum capacity of up to 16,000 cells).
- Excel-style alphanumeric coordinate system (
-
🧮 Formula Engine & Calculation:
- Supports dynamic formulas starting with
=(e.g.,=A1+B1,=(A1*2)+C3). - Evaluates mathematical expressions using referenced cell values.
- Handles invalid expressions gracefully with error fallbacks (
INVALID).
- Supports dynamic formulas starting with
-
⚡ Reactive Cell Dependency Graph:
- Leverages Pinia's
$onActionsubscriptions to listen for cell updates across the spreadsheet. - Modifying any referenced cell automatically triggers re-evaluation for all dependent formulas in real time.
- Leverages Pinia's
-
📋 Spreadsheet Copy & Paste:
- Full clipboard support for tab-delimited (
\t) and newline-separated (\n) tabular data copied directly from Google Sheets or Excel. - Intelligently spreads pasted content into adjacent rows and columns starting from the focused cell.
- Full clipboard support for tab-delimited (
-
🔄 Automatic Grid Expansion:
- Auto-expands rows and columns as you approach table boundaries.
- Automatically calculates and extends the grid dimensions if pasted data exceeds the current visible boundaries.
-
⚡ Fast & Modern Developer Experience:
- Powered by Vite 5 and Vue 3 Composition API (
<script setup>). - Modular state management powered by Pinia.
- UI styled with Vuetify 3 components.
- Powered by Vite 5 and Vue 3 Composition API (
| Technology | Description |
|---|---|
| Vue 3 | Progressive JavaScript framework using Composition API (<script setup>) |
| Vite 5 | Next-generation frontend tooling and rapid HMR dev server |
| Pinia | Intuitive, type-safe state management for reactive cell data and grid dimensions |
| Vuetify 3 | Material Design component framework for Vue |
| Vue Router 4 | Official client-side router (includes GitHub Pages compatibility route) |
| VueUse | Collection of essential Vue composition utilities |
| ESLint & Prettier | Code formatting and linting setup |
google-sheet-clone/
├── public/ # Static assets
├── src/
│ ├── assets/ # CSS styles and project images
│ ├── components/
│ │ ├── AxisCell.vue # Header cells for row numbers and column letters
│ │ └── CellItem.vue # Individual interactive cell (contenteditable, formulas, paste handler)
│ ├── plugins/
│ │ └── vuetify.js # Vuetify 3 configuration
│ ├── router/
│ │ └── index.js # Vue Router routing rules
│ ├── stores/
│ │ └── cell.js # Pinia store managing cell values, dimensions, and active cell state
│ ├── views/
│ │ ├── SheetsView.vue # Main spreadsheet view rendering the grid
│ │ └── error/
│ │ └── NotFoundView.vue # 404 fallback page
│ ├── App.vue # Root Vue component
│ ├── main.js # Application entry point
│ └── utils.js # Base-26 letter conversion, cell ID parsing & regex helpers
├── index.html # HTML template
├── package.json # Project dependencies and npm scripts
├── vite.config.js # Vite configuration
└── README.md
Clone the repository and install dependencies:
# Using pnpm (recommended)
pnpm install
# Or using npm
npm installRun the development server with Hot Module Replacement (HMR):
# Using pnpm
pnpm dev
# Or using npm
npm run devThe application will be accessible at http://localhost:5173 (or the port specified by Vite in your terminal).
Compile and minify the project for production:
# Using pnpm
pnpm build
# Or using npm
npm run buildPreview the production build locally:
pnpm preview
# or
npm run preview# Lint and fix files
pnpm lint
# Format code with Prettier
pnpm format- Coordinate System:
utils.jsprovidesnumberToLetters()andlettersToNumber()to translate numeric column indices (0-indexed) into alphanumeric column names (0 -> A,25 -> Z,26 -> AA).
- Cell State & Formulas:
- Each cell maintains both a
rawValue(what the user typed, e.g.=A1+5) and anevaluatedValue(the computed result). - In edit mode, the raw value is shown. When editing finishes or focus leaves the cell, the evaluated value is displayed.
- Each cell maintains both a
- Reactive Re-calculation:
- When a cell finishes editing, its dependents are triggered via Pinia's
$onActionlistener. All formulas referencing the updated cell ID are re-evaluated immediately.
- When a cell finishes editing, its dependents are triggered via Pinia's
- Copy-Paste Integration:
- When pasting data containing tabs (
\t) or line breaks (\n), the app automatically splits the payload into a matrix and writes values across the corresponding rows and columns in the store.
- When pasting data containing tabs (
This project is open-source and available under the MIT License.
