Sheets quick start
Mount the Excel editor and configure locale, theme, XLSX files, and a save callback.
Dependencies and styles
Use @quirekit/sheet-editor and the dependencies supplied with the same release. Within the repository, link the workspace package. For commercial distribution, use the compiled package. Sheets shares QuireKit design tokens and component styles with Classic. If your app already uses the QuireKit UnoCSS preset, you can use virtual:uno.css in place of quirekit.css.
Use the following command with your configured commercial package registry. For offline delivery, use the supplied .tgz path in place of the package name and install the dependencies supplied with that release.
pnpm add @quirekit/sheet-editor @quirekit/unocss-preset vue
import { Editor } from '@quirekit/sheet-editor'
import '@quirekit/unocss-preset/quirekit.css'
import '@quirekit/sheet-editor/styles.css'
const editor = new Editor({
locale: 'en',
licenseKey: import.meta.env.VITE_QUIREKIT_LICENSE_KEY,
}).mount('#workbook')
editor.setLocale('zh-CN')
Pass a selector or DOM element to mount(). Give the container a height, such as #workbook { height: 100dvh; }. The File menu can create a workbook, open an XLSX file, or change the interface language. Call editor.destroy() when the app unmounts.
Language and theme
Use zh-CN or en for locale. The default is Simplified Chinese. Call editor.setLocale(locale) on a running editor. Use onLocaleChange to remember a language chosen from the File menu. The workbook, selection, undo history, and authored cell contents stay in the current session. Pass a QuireKitTheme through theme as you would in Classic.
In Vue, mount to a template element in onMounted and call destroy() in onBeforeUnmount. You can also use SheetEditorWorkspace from @quirekit/sheet-editor/vue with :owner-document="document" and :options="options". Update options.locale to change its language. In Nuxt, mount the editor on the client.
Open and save an XLSX file
Pass { name, bytes } for the initial file. Once mounted, use editor.session?.open({ name, bytes }) to open another workbook. To manage storage in your app, return the save operation's promise from saveFile. The editor updates its saved state after the operation succeeds. The default action downloads an XLSX file.
import { Editor } from '@quirekit/sheet-editor'
const response = await fetch('/files/orders.xlsx')
if (!response.ok) throw new Error('Could not open the orders workbook')
const editor = new Editor({
initial: {
name: 'orders.xlsx',
bytes: new Uint8Array(await response.arrayBuffer()),
},
saveFile: async ({ bytes }) => {
const saved = await fetch('/files/orders.xlsx', {
method: 'PUT',
headers: {
'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
},
body: Uint8Array.from(bytes),
})
if (!saved.ok) throw new Error('Could not save the orders workbook')
},
}).mount('#workbook')
Your app provides the file endpoints in this example. Users can also open local XLSX files from the File menu and process them entirely in the browser.
Choose File → Export → CSV (current sheet) to download the current worksheet's displayed values. The UTF-8 file uses the worksheet name and includes hidden rows and columns and the current formula results. The browser delivers the CSV directly. The host's saveFile callback handles XLSX saves.