Skip to content

Svelte API Reference

Svelte 5 Integration Reference
Reference
[1]

Svelte Adapter

The @velo-sci/notebook-svelte package is optimized for Svelte 5+ runes.

[2]

Usage

[3]
<script>
  import { SciNotebookSvelte } from '@velo-sci/notebook-svelte';
  import { onMount } from 'svelte';

  let container;
  let notebook;

  onMount(() => {
    notebook = new SciNotebookSvelte({
      target: container,
      notebook: initialData,
      theme: 'light',
      onChange: (nb) => { console.log(nb); }
    });

    return () => notebook.destroy();
  });
</script>

<div bind:this={container}></div>

Integrated under the Sci DNA / VeloSci Ecosystem