Notebook Cell

A Jupyter style notebook cell with a Run button beside a code editor frame and an optional output panel below. Good for interactive docs and playgrounds.

src/registry/ui/notebook-cell.tsx/r/notebook-cell.json

Installation#

bash
npx shadcn@latest add @minidev/notebook-cell

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/notebook-cell.json

Usage#

tsx
import { NotebookCell } from "@/components/ui/notebook-cell"

export function Example() {
  return (
    <NotebookCell code={"const n = 42\nconsole.log(n)"} output="42" />
  )
}

API reference#

NotebookCell props
PropTypeDefault
code*string-
outputstring-
onRun() => void-
classNamestring-

* required

Dependencies#

npm

lucide-react

Examples#

All Developer tool UI components for React