Skip to content

Vanilla JS API Reference

Vanilla JS Integration Reference
Reference
[1]

Vanilla JS Adapter

The @velo-sci/notebook-vanilla package can be used in any environment.

[2]

Installation

[3]
npm install @velo-sci/notebook-vanilla
[4]

Usage

[5]
import { SciNotebookVanilla } from '@velo-sci/notebook-vanilla';
import '@velo-sci/notebook-core/styles/index.css';

const app = document.getElementById('app');

const notebook = new SciNotebookVanilla({
  target: app,
  notebook: myInitialData,
  theme: 'light',
  showToolbar: true,
  onChange: (updatedNotebook) => {
    console.log('Notebook changed:', updatedNotebook);
  }
});

// Imperative access to the engine
const engine = notebook.getEngine();
engine.insertCell(0, 'markdown', '# New Cell');

// Cleanup
// notebook.destroy();
[6]

Configuration Options

[7]
Option Type Default Description
target HTMLElement Required hook for mounting
notebook Notebook Initial notebook state
theme string "light" Visual theme
showToolbar boolean true UI visibility
onChange Function Change listener

Integrated under the Sci DNA / VeloSci Ecosystem