nteract elements

ExecutionCount

Displays the classic Jupyter execution count indicator with bracket notation

[ ]:[*]:[1]:[42]:

A cell primitive that displays the classic Jupyter execution count indicator. Uses the familiar bracket notation: [ ]: for never executed, [*]: for currently executing, and [n]: for executed cells.

Installation

npx shadcn@latest add https://nteract-elements.vercel.app/r/execution-count.json

Copy the component from nteract/elements.

Usage

import { ExecutionCount } from "@/registry/cell/ExecutionCount"

export function CellGutter() {
  return (
    <div className="flex items-center">
      <ExecutionCount count={1} />
    </div>
  )
}

States

Never Executed

When count is null and isExecuting is false, displays empty brackets.

[ ]:[ ]:
<ExecutionCount count={null} />

Executing

When isExecuting is true, displays an asterisk to indicate the cell is running.

[*]:[*]:
<ExecutionCount count={null} isExecuting />

Executed

When count is a number, displays the execution count.

[1]:[5]:[42]:
<ExecutionCount count={1} />
<ExecutionCount count={5} />
<ExecutionCount count={42} />

Props

PropTypeDefaultDescription
countnumber | nullThe execution count. null for never executed.
isExecutingbooleanfalseWhether the cell is currently executing
classNamestringAdditional CSS classes

On this page