Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork59
⚛️ React.js components 💯% compatible with 🪐 Jupyter.
License
datalayer/jupyter-ui
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
React.js components 💯% compatible with 🪐 Jupyter.
Documentation:https://jupyter-ui.datalayer.tech
Jupyter UI is a set ofReact.js components that allow a frontend/webapp developer to build data products compatible with theJupyter ecosystem. The user interface delivers executable notebooks, cells, terminals, file browsers and allows the developer to manage a full integrated React tree instead of relying on iframes to display the Jupyter notebooks.
Package | Version | Description |
---|---|---|
@datalayer/jupyter-react | Generic React components for Jupyter | |
@datalayer/jupyter-lexical | Rich text editor with Lexical framework | |
@datalayer/jupyter-docusaurus-plugin | Docusaurus plugin for Jupyter notebooks | |
datalayer-jupyter-vscode | VS Code extension |
npm install @datalayer/jupyter-react
import{JupyterReactTheme,Notebook}from'@datalayer/jupyter-react';functionApp(){return(<JupyterReactTheme><Notebookpath="notebook.ipynb"id="notebook-id"startDefaultKernel/></JupyterReactTheme>);}
Jupyter UI supports real-time collaboration through a pluggable provider system:
import{Notebook,JupyterCollaborationProvider,}from'@datalayer/jupyter-react';functionCollaborativeNotebook(){constcollaborationProvider=newJupyterCollaborationProvider();return(<Notebookpath="notebook.ipynb"collaborationProvider={collaborationProvider}/>);}
You can create your own collaboration provider by extendingCollaborationProviderBase
:
import{CollaborationProviderBase}from'@datalayer/jupyter-react';classMyCustomProviderextendsCollaborationProviderBase{constructor(config){super('my-provider-type');// Initialize your provider}asyncconnect(sharedModel,documentId,options){// Implement your connection logic// Set up WebSocket, authenticate, etc.}}// Use it with any Notebook componentconstprovider=newMyCustomProvider({/* config */});<NotebookcollaborationProvider={provider}path="notebook.ipynb"/>;
As a developer start with thesetup of your environment and tryone of the examples. We havedocumentation for more details.
# Clone the repositorygit clone https://github.com/datalayer/jupyter-ui.gitcd jupyter-ui# Install dependenciesnpm install# Build all packagesnpm run build# Start Jupyter server (required for development)npm run jupyter:server# Run an examplenpm run jupyter:ui:vite
You can try the CodeSandbox examples:
- Notebook with Create React App
- Notebook with Next.js
- Simple Cell Component - You may need to refresh the sandbox navigator
We host a Storybook on ✨https://jupyter-ui-storybook.datalayer.tech that showcases various low-level and high-level React.js components useful to build a Data Product.
- 📓 Notebook - Full notebook interface with cells, outputs, and toolbar
- 📝 Cell - Individual code/markdown cells with execution
- 💻 Console - Interactive Jupyter console
- 🖥️ Terminal - Web-based terminal interface
- 📁 FileBrowser - File system navigation and management
- ⚙️ Kernel Management - Kernel lifecycle and execution control
- 📊 Output Rendering - Display of execution results, plots, and widgets
- 🔌 IPyWidgets Support - Full support for interactive widgets
- 👥 Collaborative Editing - Pluggable provider system supporting:
- Jupyter collaboration (WebSocket-based with Y.js)
- Custom providers via
ICollaborationProvider
interface
- 🎨 Theming - JupyterLab theme support with dark/light modes
- 🔧 Extensible - Plugin system for custom functionality
- 🚀 Performance - Virtual scrolling, lazy loading, and optimizations
- 🔒 Security - Token authentication, CORS, XSS protection
- 🏗️ Clean Architecture - Modular, composable components with clear interfaces
- 🔄 Composition Pattern - Components compose rather than inherit for maximum flexibility
- 🔌 Provider System - Pluggable collaboration providers for different backends
- 📦 One-way Dependencies - Core depends on jupyter-react, not vice versa
The above image shows a gallery of the available React.js components ready to be used in you custom application. These open source components are used to buildDatalayer, a collaborative platform for data analysis.
The Jupyter(Lab) notebook is a tool that allows data scientist to analyse dataset. However, it is not easy to create a custom user interface integrated in an existing application.Jupyter UI, an open-source library, fills that gap and provides components that a developer can easily integrate in any React.js application.
The Jupyter(Lab) user interface is built on top of Lumino widget toolkit, an imperative way to build user interface andcan not be consumed by industry standard declarative frameworks like React.js. As a user interface developer, if you want to create a custom data product on top of Jupyter, you have to stick to Lumino and carry-on the full notebook interface not tailored to your specific needs. This is not what you want. You just want to expose what you need, you want to develop with your favorite toolkit (like React.js) and you also want to integrate on a per-component basis the Jupyter functionality in your application.
We also aim removing the rigidity of the extension system and favorcomposition over inheritance.
IPyWidgets are supported (the Comm feature needs to be fixed). JupyterLite and PyScript support is on the roadmap. Autocompletion is also available.
You can find more context reading thisabstract of the talk given atFOSDEM 2022 (video recording).
Full server-side rendering support with theNext.js example.
We maintain a plugin forDocusaurus in thedocusaurus-plugin package (see theDocusaurus example).
- Vite - Modern build tool integration (example)
- Create React App - Classic React app setup
- Lexical - Rich text editing capabilities (example)
- VS Code - Extension for notebook editing (package)
- Node.js >= 20.0.0
- npm >= 8.0.0
- Python >= 3.8 (for Jupyter server)
- JupyterLab >= 4.0.0
We welcome contributions! Please see ourContributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run tests (
npm test
) - Run code quality checks (
npm run check
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to your branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- TypeScript - Strict type checking enabled
- ESLint - Modern flat config with React and TypeScript rules
- Prettier - Consistent code formatting
- Husky - Pre-commit hooks for quality checks
- Commitlint - Conventional commit messages
Run all checks with a single command:
npm run check# Run format check, lint, and type-checknpm run check:fix# Run format, lint fix, and type-check
Copyright (c) 2022-2025 Datalayer, Inc.
Released under the terms of the MIT license (seeLICENSE).
About
⚛️ React.js components 💯% compatible with 🪐 Jupyter.
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.