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 instanceuseNotebook(): Reactive notebook stateuseCell(cellId): Reactive cell stateuseFocusedCell(): Currently focused cell IDuseNotebookEvent(event, handler): Subscribe to engine events