@baybreezy/nuxt-excel-editor
v0.0.1
Published
A spreadsheet editor for Nuxt: formulas, XLSX and CSV, records mode, and theming that matches your design system
Maintainers
Readme
A local-first spreadsheet editor for Nuxt 3.13+ and Nuxt 4 (Node.js 20.19+). Drop <NuxtExcelEditor> into a page to get an Excel-style workbook with live formulas, multiple sheets, XLSX and CSV files, and a records mode for editing arrays of objects. It reads your design system's tokens, so it looks like the rest of your app.
Built on Univer (canvas grid and formula engine, Apache-2.0) and Hucre (XLSX and CSV). Everything runs in the browser; your app owns persistence.
Features
- Workbook mode:
v-modela versioned JSON snapshot of a multi-sheet workbook. - Records mode:
v-model:rows+columnsfor arrays of objects, with typed columns, dropdowns, checkboxes, read-only fields, validation, and{ added, updated, removed }change events. - Files: open, drop and download XLSX and CSV. Styles, merges, frozen panes, hyperlinks, notes, data validation, autofilters and conditional formatting survive the round trip; anything else is reported as a compatibility notice.
- Theming:
theme="auto"reads UI Thing / shadcn-vue, Nuxt UI or Tailwind v4 tokens. Dark mode and theme switches repaint live. Every value is a--nee-*CSS variable, and styles sit in thecomponentscascade layer so your utilities win. - Opt-in features: hyperlinks, notes, images, tables, comments and crosshair highlighting. Only enabled features are bundled.
- API: selection, cell, click and sheet events;
importFile,exportFile,download,undo,redo, and Univer's facade API through a typed ref;useExcelWorkbook()for persistence.
Quick start
npx nuxt module add @baybreezy/nuxt-excel-editor
# or
npm install @baybreezy/nuxt-excel-editor// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@baybreezy/nuxt-excel-editor'],
excelEditor: {
features: { hyperlink: true, note: true },
},
})<script setup lang="ts">
const { snapshot } = useExcelWorkbook('budget')
</script>
<template>
<NuxtExcelEditor v-model="snapshot" :height="600" />
</template>Records mode:
<script setup lang="ts">
import type { ExcelColumn } from '@baybreezy/nuxt-excel-editor'
const tasks = ref([{ id: 1, title: 'Write the brief', status: 'todo', estimate: 3 }])
const columns: ExcelColumn[] = [
{ field: 'id', label: 'ID', type: 'number', readonly: true },
{ field: 'title', label: 'Task', required: true },
{ field: 'status', type: 'select', options: ['todo', 'doing', 'done'] },
{ field: 'estimate', label: 'Hours', type: 'number' },
]
</script>
<template>
<NuxtExcelEditor v-model:rows="tasks" :columns="columns" row-key="id" />
</template>Documentation
The Docd site has the full guide, the theming reference (every CSS variable), the API reference and live examples. Run it with npm run dev:
/: landing page/docs/getting-started/introduction: guides and reference/docs/theming/overview: theming, with a live playground/demo: full-screen playground
For AI agents
The docs site runs an MCP server at /mcp with list-pages and get-page tools, so coding agents (Claude Code, Cursor, VS Code and others) can look up the guides and API while they work. It also serves /llms.txt and /llms-full.txt.
Development
npm ci # also installs the Git hooks
npm run dev # docs site with live examples
npm run lint # ESLint
npm run format # Prettier
npm run typecheck # module sources and docs app
npm test # unit tests (Vitest)
npx playwright install chromium
npm run test:browser # docs browser tests (Playwright)
npm run test:consumer -- --nuxt 3 --variant plain # pack, install into a real Nuxt app, build and test
npm run prepack # build dist/test:consumer takes --nuxt <version range> and --variant plain|nuxt-ui. CI runs it for Nuxt 3.13.0, the latest Nuxt 3 and the latest Nuxt 4 on Node.js 20, 22 and 24, plus Nuxt UI apps on Nuxt 3 and 4.
Commits follow Conventional Commits (feat:, fix:, docs: …), checked by commitlint. Staged files are linted and formatted before each commit.
Releasing
Releases use changelogen and a tag-triggered publish workflow.
npm run release # the bump comes from the commits (fix = patch, feat = minor, breaking = major)
npm run release -- -r 1.2.3 # or set the version yourself (it must differ from package.json)This updates CHANGELOG.md (edit the generated notes on the GitHub release if you want them friendlier), commits chore(release): vX.Y.Z, tags it, pushes, and creates the GitHub release (it reads your token from gh auth token). Pushing the tag starts .github/workflows/release.yml, which checks that the tag matches package.json, runs lint, typecheck and tests, and publishes to npm with provenance. Tags with a suffix such as v0.1.0-beta.1 publish under the next dist-tag.
One-time setup: add an npm automation token as the NPM_TOKEN secret in a GitHub environment named npm (Settings → Environments).
For the optional XLSX interoperability test, save the Apache POI Excel-authored shared formula workbook as excel.xlsx and export the Google Sheets sample schedule as google.xlsx into one directory, then run NEE_EXTERNAL_FIXTURES=/path/to/fixtures npm test.
Not included yet
Charts, pivot tables, QUERY and ARRAYFORMULA, print layout, and real-time collaboration are not part of this module. Univer offers some of these in its commercial packages.
