For developers

8sheets is written in plain JavaScript modules with no runtime dependencies and no build step. The same workbook model runs in the browser and in Node, so the API covers two uses:

  • Embedding. Mount the full app, or only the parts you need, inside any element of your page.
  • Headless. Create, read, calculate and save workbooks with no page at all, for example on a server.
import { createWorkbook, mountWorkbook } from './src/api/index.js';

// No page needed; this also runs in Node.
const wb = createWorkbook({ sheets: 2 });
const sheet = wb.activeSheet;
sheet.range('A1').values = [['Item', 'Qty'], ['Pens', 4]];
sheet.range('C2').formulas = [['=B2*2']];
await wb.whenCalculated();

// The full app in an element of your page.
const app = await mountWorkbook(document.querySelector('#sheet'), { chrome: 'light' });

What the API offers

  • Workbooks, sheets, ranges, tables and names, with values, formulas and styles.
  • Fast bulk paths that write typed arrays straight into cell storage.
  • Events for cell changes, selection, editing, the clipboard, sheets and objects, with cancellable before- events.
  • Undo groups, commands and key bindings.
  • Saving to .xlsx, to the .8sh format that keeps everything, or to plain JSON.
  • Themes, interface language, context menus, the ribbon and the status bar.

Availability

The embedding API is not published as a package yet, and its licence for use in other products is not decided.

The API reference documents every class, event, option and command as they stand today.