Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

ux: runtime configuration tooltips, docs (#7819)

Akshay Agrawal74e6e0027507
diff --git a/docs/guides/configuration/runtime_configuration.md b/docs/guides/configuration/runtime_configuration.md
index 989bd30ebb..02803f2356 100644
--- a/docs/guides/configuration/runtime_configuration.md
+++ b/docs/guides/configuration/runtime_configuration.md
@@ -1,32 +1,19 @@
# Runtime configuration
-Through the notebook settings menu, you can configure how and when marimo runs
-cells.
+Through the notebook settings menu or notebook footer, you can configure how
+and when marimo runs cells.
<video controls width="100%" height="100%" align="center" src="/_static/docs-runtime-config.mp4"> </video>
-## Disable autorun on startup { #on-startup }
+## On startup { #on-startup }
-By default, marimo notebooks run automatically on startup; just how the command
-
-```bash
-python main.py
-```
-
-executes a script,
-
-```bash
-marimo edit notebook.py
-```
-
-executes the notebook.
-
-Disable this behavior by unchecking "Autorun on startup".
+Toggle this setting to control whether marimo notebooks opened with `marimo
+edit` automatically run on startup
_When sharing a notebook as an app with `marimo run`, this setting has
no effect._
-## Disable autorun on cell change (lazy execution)
+## On cell change: disabling autorun on cell change (lazy execution)
<video controls width="100%" height="100%" align="center" src="/_static/docs-lazy-execution.mp4"> </video>
diff --git a/frontend/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx b/frontend/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx
index 4120288762..a500841dd3 100644
--- a/frontend/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx
+++ b/frontend/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx
@@ -2,6 +2,8 @@
import {
ChevronDownIcon,
+ ExternalLinkIcon,
+ InfoIcon,
PowerOffIcon,
ZapIcon,
ZapOffIcon,
@@ -15,7 +17,9 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
+import { ExternalLink } from "@/components/ui/links";
import { Switch } from "@/components/ui/switch";
+import { Tooltip, TooltipProvider } from "@/components/ui/tooltip";
import { useResolvedMarimoConfig } from "@/core/config/config";
import { useRequestClient } from "@/core/network/requests";
import { isWasm } from "@/core/wasm/utils";
@@ -99,117 +103,167 @@ export const RuntimeSettings: React.FC<RuntimeSettingsProps> = ({
</FooterItem>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="w-64">
- <DropdownMenuLabel>Runtime reactivity</DropdownMenuLabel>
+ <DropdownMenuLabel>
+ <div className="flex items-center justify-between w-full">
+ <span>Runtime reactivity</span>
+ <ExternalLink href="https://links.marimo.app/runtime-configuration">
+ <span className="text-xs font-normal flex items-center gap-1">
+ Docs
+ <ExternalLinkIcon className="w-3 h-3" />
+ </span>
+ </ExternalLink>
+ </div>
+ </DropdownMenuLabel>
<DropdownMenuSeparator />
- {/* On startup toggle */}
- <DisableIfOverridden name="runtime.auto_instantiate">
- <div className="flex items-center justify-between px-2 py-2">
- <div className="flex items-center space-x-2">
- {config.runtime.auto_instantiate ? (
- <ZapIcon size={14} className="text-amber-500" />
- ) : (
- <ZapOffIcon size={14} className="text-muted-foreground" />
- )}
- <div>
- <div className="text-sm font-medium">On startup</div>
- <div className="text-xs text-muted-foreground">
- {config.runtime.auto_instantiate ? "autorun" : "lazy"}
+ <TooltipProvider>
+ {/* On startup toggle */}
+ <DisableIfOverridden name="runtime.auto_instantiate">
+ <div className="flex items-center justify-between px-2 py-2">
+ <div className="flex items-center space-x-2">
+ {config.runtime.auto_instantiate ? (
+ <ZapIcon size={14} className="text-amber-500" />
+ ) : (
+ <ZapOffIcon size={14} className="text-muted-foreground" />
+ )}
+ <div>
+ <div className="text-sm font-medium flex items-center gap-1">
+ On startup
+ <Tooltip
+ content={
+ <div className="max-w-[200px]">
+ Whether to automatically run the notebook on startup
+ </div>
+ }
+ >
+ <InfoIcon className="w-3 h-3" />
+ </Tooltip>
+ </div>
+ <div className="text-xs text-muted-foreground">
+ {config.runtime.auto_instantiate ? "autorun" : "lazy"}
+ </div>
</div>
</div>
+ <Switch
+ checked={config.runtime.auto_instantiate}
+ onCheckedChange={handleStartupToggle}
+ size="sm"
+ />
</div>
- <Switch
- checked={config.runtime.auto_instantiate}
- onCheckedChange={handleStartupToggle}
- size="sm"
- />
- </div>
- </DisableIfOverridden>
+ </DisableIfOverridden>
- <DropdownMenuSeparator />
+ <DropdownMenuSeparator />
- {/* On cell change toggle */}
- <DisableIfOverridden name="runtime.on_cell_change">
- <div className="flex items-center justify-between px-2 py-2">
- <div className="flex items-center space-x-2">
- {config.runtime.on_cell_change === "autorun" ? (
- <ZapIcon size={14} className="text-amber-500" />
- ) : (
- <ZapOffIcon size={14} className="text-muted-foreground" />
- )}
- <div>
- <div className="text-sm font-medium">On cell change</div>
- <div className="text-xs text-muted-foreground">
- {config.runtime.on_cell_change}
+ {/* On cell change toggle */}
+ <DisableIfOverridden name="runtime.on_cell_change">
+ <div className="flex items-center justify-between px-2 py-2">
+ <div className="flex items-center space-x-2">
+ {config.runtime.on_cell_change === "autorun" ? (
+ <ZapIcon size={14} className="text-amber-500" />
+ ) : (
+ <ZapOffIcon size={14} className="text-muted-foreground" />
+ )}
+ <div>
+ <div className="text-sm font-medium flex items-center gap-1">
+ On cell change
+ <Tooltip
+ content={
+ <div className="max-w-[300px]">
+ Whether to automatically run dependent cells after
+ running a cell
+ </div>
+ }
+ >
+ <InfoIcon className="w-3 h-3" />
+ </Tooltip>
+ </div>
+ <div className="text-xs text-muted-foreground">
+ {config.runtime.on_cell_change}
+ </div>
</div>
</div>
+ <Switch
+ checked={config.runtime.on_cell_change === "autorun"}
+ onCheckedChange={handleCellChangeToggle}
+ size="sm"
+ />
</div>
- <Switch
- checked={config.runtime.on_cell_change === "autorun"}
- onCheckedChange={handleCellChangeToggle}
- size="sm"
- />
- </div>
- </DisableIfOverridden>
+ </DisableIfOverridden>
- {!isWasm() && (
- <>
- <DropdownMenuSeparator />
+ {!isWasm() && (
+ <>
+ <DropdownMenuSeparator />
- {/* On module change dropdown */}
- <DisableIfOverridden name="runtime.auto_reload">
- <div className="px-2 py-1">
- <div className="flex items-center space-x-2 mb-2">
- {config.runtime.auto_reload === "off" && (
- <PowerOffIcon size={14} className="text-muted-foreground" />
- )}
- {config.runtime.auto_reload === "lazy" && (
- <ZapOffIcon size={14} className="text-muted-foreground" />
- )}
- {config.runtime.auto_reload === "autorun" && (
- <ZapIcon size={14} className="text-amber-500" />
- )}
- <div>
- <div className="text-sm font-medium">On module change</div>
- <div className="text-xs text-muted-foreground">
- {config.runtime.auto_reload}
+ {/* On module change dropdown */}
+ <DisableIfOverridden name="runtime.auto_reload">
+ <div className="px-2 py-1">
+ <div className="flex items-center space-x-2 mb-2">
+ {config.runtime.auto_reload === "off" && (
+ <PowerOffIcon
+ size={14}
+ className="text-muted-foreground"
+ />
+ )}
+ {config.runtime.auto_reload === "lazy" && (
+ <ZapOffIcon size={14} className="text-muted-foreground" />
+ )}
+ {config.runtime.auto_reload === "autorun" && (
+ <ZapIcon size={14} className="text-amber-500" />
+ )}
+ <div>
+ <div className="text-sm font-medium flex items-center gap-1">
+ On module change
+ <Tooltip
+ content={
+ <div className="max-w-[300px]">
+ Whether to run affected cells, mark them as stale,
+ or do nothing when an external module is updated
+ </div>
+ }
+ >
+ <InfoIcon className="w-3 h-3" />
+ </Tooltip>
+ </div>
+ <div className="text-xs text-muted-foreground">
+ {config.runtime.auto_reload}
+ </div>
</div>
</div>
+ <div className="space-y-1">
+ {["off", "lazy", "autorun"].map((option) => (
+ <button
+ key={option}
+ onClick={() =>
+ handleModuleReloadChange(
+ option as "off" | "lazy" | "autorun",
+ )
+ }
+ className={cn(
+ "w-full flex items-center px-2 py-1 text-sm rounded hover:bg-accent",
+ option === config.runtime.auto_reload && "bg-accent",
+ )}
+ >
+ {option === "off" && (
+ <PowerOffIcon size={12} className="mr-2" />
+ )}
+ {option === "lazy" && (
+ <ZapOffIcon size={12} className="mr-2" />
+ )}
+ {option === "autorun" && (
+ <ZapIcon size={12} className="mr-2" />
+ )}
+ <span className="capitalize">{option}</span>
+ {option === config.runtime.auto_reload && (
+ <span className="ml-auto">✓</span>
+ )}
+ </button>
+ ))}
+ </div>
</div>
- <div className="space-y-1">
- {["off", "lazy", "autorun"].map((option) => (
- <button
- key={option}
- onClick={() =>
- handleModuleReloadChange(
- option as "off" | "lazy" | "autorun",
- )
- }
- className={cn(
- "w-full flex items-center px-2 py-1 text-sm rounded hover:bg-accent",
- option === config.runtime.auto_reload && "bg-accent",
- )}
- >
- {option === "off" && (
- <PowerOffIcon size={12} className="mr-2" />
- )}
- {option === "lazy" && (
- <ZapOffIcon size={12} className="mr-2" />
- )}
- {option === "autorun" && (
- <ZapIcon size={12} className="mr-2" />
- )}
- <span className="capitalize">{option}</span>
- {option === config.runtime.auto_reload && (
- <span className="ml-auto">✓</span>
- )}
- </button>
- ))}
- </div>
- </div>
- </DisableIfOverridden>
- </>
- )}
+ </DisableIfOverridden>
+ </>
+ )}
+ </TooltipProvider>
</DropdownMenuContent>
</DropdownMenu>
);
diff --git a/marimo/_tutorials/intro.py b/marimo/_tutorials/intro.py
index 054605ff70..f4fb65d6e9 100644
--- a/marimo/_tutorials/intro.py
+++ b/marimo/_tutorials/intro.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.17.4"
+__generated_with = "0.19.2"
app = marimo.App()
@@ -22,8 +22,7 @@ def _(mo):
@app.cell
def _(mo, slider):
- mo.md(
- f"""
+ mo.md(f"""
marimo is a **reactive** Python notebook.
This means that unlike traditional notebooks, marimo notebooks **run
@@ -31,8 +30,7 @@ def _(mo, slider):
interact with UI elements, like this slider: {slider}.
{"##" + "🍃" * slider.value}
- """
- )
+ """)
return