Skip to content

React API Reference

React Integration Reference
Reference
[1]

React Adapter

The @velo-sci/notebook-react package provides a seamless integration with React 18+.

[2]

Usage

[3]
import { SciNotebook } from '@velo-sci/notebook-react';
import '@velo-sci/notebook-core/styles/index.css';

<SciNotebook
  notebook={initialNotebook}
  theme="dark"
  onChange={(nb) => console.log('Updated', nb)}
  onCellFocus={(cellId) => console.log('Focused:', cellId)}
  engineRef={engineRef}
  readOnly={false}
  showToolbar={true}
  plugins={[latexPlugin]}
/>
[4]

Available Hooks

[5]
  • useSciNotebook(): Access the engine instance
  • useNotebook(): Reactive notebook state
  • useCell(cellId): Reactive cell state
  • useFocusedCell(): Currently focused cell ID
  • useNotebookEvent(event, handler): Subscribe to engine events

Integrated under the Sci DNA / VeloSci Ecosystem