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.

swap reveal.js instead of swiper for slides (#9166)

Shahmir Varqha9691518354ab
diff --git a/frontend/e2e-tests/slides.spec.ts b/frontend/e2e-tests/slides.spec.ts
index 78857a46de..9497ccc9b8 100644
--- a/frontend/e2e-tests/slides.spec.ts
+++ b/frontend/e2e-tests/slides.spec.ts
@@ -24,26 +24,24 @@ test("slides", async ({ page }) => {
await openCommandPalette({ page, command: "Present as Slides" });
- // Wait for slides mode - Swiper adds .swiper class and component has .mo-slides-theme
- const slidesContainer = page.locator(".swiper.mo-slides-theme");
+ // Wait for slides mode - reveal.js adds .reveal class
+ const slidesContainer = page.locator(".reveal.mo-slides-theme");
await expect(slidesContainer).toBeVisible();
await takeScreenshot(page, __filename);
- // Check pagination shows we're on first slide (bullet 1 is active)
- // Use pagintion bullets instead of text because the library (Swiper) puts all elements in the viewport.
- const paginationBullets = page.locator(".swiper-pagination-bullet");
- await expect(paginationBullets.first()).toHaveClass(
- /swiper-pagination-bullet-active/,
- );
+ // Reveal.js marks the active slide <section> with .present
+ const slides = slidesContainer.locator(".slides > section");
+ await expect(slides.first()).toHaveClass(/present/);
+
+ // Focus the deck so keyboard navigation works (embedded mode)
+ await slidesContainer.click();
// Navigate to next slide using right arrow key
await page.keyboard.press("ArrowRight");
- // Verify we moved to second slide via pagination
- await expect(paginationBullets.nth(1)).toHaveClass(
- /swiper-pagination-bullet-active/,
- );
+ // Verify we moved to second slide
+ await expect(slides.nth(1)).toHaveClass(/present/);
await takeScreenshot(page, __filename);
@@ -51,29 +49,28 @@ test("slides", async ({ page }) => {
await page.keyboard.press("ArrowLeft");
// Verify we're back on the first slide
- await expect(paginationBullets.first()).toHaveClass(
- /swiper-pagination-bullet-active/,
- );
+ await expect(slides.first()).toHaveClass(/present/);
});
test("slides fullscreen", async ({ page }) => {
await openCommandPalette({ page, command: "Present as Slides" });
- // Wait for slides mode - Swiper adds .swiper class and component has .mo-slides-theme
- const slidesContainer = page.locator(".swiper.mo-slides-theme");
+ // Wait for slides mode - reveal.js adds .reveal class
+ const slidesContainer = page.locator(".reveal.mo-slides-theme");
await expect(slidesContainer).toBeVisible();
- // Test buttons
- await expect(page.getByText("Fullscreen")).toBeVisible();
- await page.getByText("Fullscreen").click();
-
- await expect(page.getByText("Exit Fullscreen")).toBeVisible();
- await page.getByText("Exit Fullscreen").click();
+ // Fullscreen button is hidden until hover
+ const fullscreenButton = page.getByTestId("marimo-plugin-slides-fullscreen");
+ const slidesWrapper = slidesContainer.locator("..");
+ await slidesWrapper.hover();
+ await expect(fullscreenButton).toBeVisible();
- await expect(page.getByText("Fullscreen")).toBeVisible();
- await page.getByText("Fullscreen").click();
+ // Enter fullscreen
+ await fullscreenButton.click();
- // Test Escape key for exiting fullscreen
+ // Exit fullscreen with Escape
await page.keyboard.press("Escape");
- await expect(page.getByText("Fullscreen")).toBeVisible();
+
+ // Slides container should still be visible after exiting fullscreen
+ await expect(slidesContainer).toBeVisible();
});
diff --git a/frontend/package.json b/frontend/package.json
index 787d136d5a..b6b388a4e7 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -69,6 +69,7 @@
"@radix-ui/react-icons": "~1.3.2",
"@radix-ui/react-use-controllable-state": "~1.2.2",
"@replit/codemirror-vim": "^6.3.0",
+ "@revealjs/react": "^0.2.1",
"@streamdown/math": "^1.0.1",
"@tailwindcss/postcss": "^4.1.18",
"@tailwindcss/typography": "^0.5.19",
@@ -141,6 +142,7 @@
"react-virtuoso": "^4.18.1",
"reactflow": "^11.11.4",
"remark-gfm": "^4.0.1",
+ "reveal.js": "^6.0.0",
"rpc-anywhere": "^1.7.0",
"sql-formatter": "^15.7.0",
"streamdown": "^2.1.0",
diff --git a/frontend/src/components/editor/renderers/slides-layout/slides-layout.tsx b/frontend/src/components/editor/renderers/slides-layout/slides-layout.tsx
index 0d29c2170e..f9c835c11d 100644
--- a/frontend/src/components/editor/renderers/slides-layout/slides-layout.tsx
+++ b/frontend/src/components/editor/renderers/slides-layout/slides-layout.tsx
@@ -1,18 +1,18 @@
/* Copyright 2026 Marimo. All rights reserved. */
-import React, { useState } from "react";
+import React, { useRef, useState } from "react";
import { useAtomValue } from "jotai";
import { numColumnsAtom } from "@/core/cells/cells";
import type { CellId } from "@/core/cells/ids";
import type { ICellRendererProps } from "../types";
import type { SlidesLayout } from "./types";
import { SlidesMinimap } from "@/components/slides/minimap";
-import { Slide } from "@/components/slides/slide";
import useEvent from "react-use-event-hook";
+import type { RevealApi } from "reveal.js";
type Props = ICellRendererProps<SlidesLayout>;
const LazySlidesComponent = React.lazy(
- () => import("../../../slides/slides-component"),
+ () => import("../../../slides/reveal-component"),
);
export const SlidesLayoutRenderer: React.FC<Props> = ({
@@ -26,6 +26,7 @@ export const SlidesLayoutRenderer: React.FC<Props> = ({
const numColumns = useAtomValue(numColumnsAtom);
const isMultiColumn = numColumns > 1;
const [activeCellId, setActiveCellId] = useState<CellId | null>(null);
+ const deckRef = useRef<RevealApi | null>(null);
const cellsWithOutput = cells.filter(
(cell) => cell.output != null && cell.output.data !== "",
@@ -45,24 +46,15 @@ export const SlidesLayoutRenderer: React.FC<Props> = ({
const slides = (
<LazySlidesComponent
- forceKeyboardNavigation={true}
- className="flex-1 self-center"
+ cellsWithOutput={cellsWithOutput}
activeIndex={resolvedIndex}
- onActiveIndexChange={handleSlideChange}
- >
- {cellsWithOutput.map((cell) => (
- <Slide
- key={cell.id}
- cellId={cell.id}
- status={cell.status}
- output={cell.output}
- />
- ))}
- </LazySlidesComponent>
+ onSlideChange={handleSlideChange}
+ deckRef={deckRef}
+ />
);
if (isReading) {
- return <div className="p-4 flex flex-col flex-1 max-h-[95%]">{slides}</div>;
+ return <div className="p-4 flex flex-1 max-h-[95%]">{slides}</div>;
}
return (
diff --git a/frontend/src/components/slides/reveal-component.tsx b/frontend/src/components/slides/reveal-component.tsx
new file mode 100644
index 0000000000..4c0bb97de2
--- /dev/null
+++ b/frontend/src/components/slides/reveal-component.tsx
@@ -0,0 +1,109 @@
+/* Copyright 2026 Marimo. All rights reserved. */
+
+import { useEffect } from "react";
+import { ExpandIcon } from "lucide-react";
+import { Deck, Slide } from "@revealjs/react";
+import { Slide as CellOutputSlide } from "@/components/slides/slide";
+import { Button } from "@/components/ui/button";
+import { Tooltip } from "@/components/ui/tooltip";
+import type { CellData, CellRuntimeState } from "@/core/cells/types";
+import type { RevealApi } from "reveal.js";
+import { Events } from "@/utils/events";
+import { Logger } from "@/utils/Logger";
+
+import "./slides.css";
+import "./reveal-slides.css";
+
+const RevealSlidesComponent = ({
+ cellsWithOutput,
+ activeIndex,
+ onSlideChange,
+ deckRef,
+}: {
+ cellsWithOutput: (CellRuntimeState & CellData)[];
+ activeIndex?: number;
+ onSlideChange?: (index: number) => void;
+ deckRef: React.RefObject<RevealApi | null>;
+}) => {
+ useEffect(() => {
+ const deck = deckRef.current;
+ if (deck == null || activeIndex == null) {
+ return;
+ }
+ const { h } = deck.getIndices();
+ if (h !== activeIndex) {
+ deck.slide(activeIndex);
+ }
+ }, [activeIndex, deckRef]);
+
+ return (
+ <div className="group relative h-full w-full flex-1">
+ <Deck
+ deckRef={deckRef}
+ className="relative w-full h-full border rounded bg-background mo-slides-theme prose-slides"
+ style={{ height: "100%" }}
+ config={{
+ embedded: true, // Avoid styles leaking out
+ overview: false,
+ width: "100%",
+ height: "100%", // Both style and config height are needed to ensure the deck is full height
+ center: false, // We are handling this manually
+ minScale: 1,
+ maxScale: 1,
+ // Only enable keyboard controls when not focused on an input
+ keyboardCondition: (event: KeyboardEvent) => {
+ return !Events.fromInput(event);
+ },
+ }}
+ onSlideChange={() => {
+ const deck = deckRef.current;
+ if (deck) {
+ onSlideChange?.(deck.getIndices().h);
+ // Trigger resize so vega-embed re-measures container width
+ if (
+ deck.getCurrentSlide()?.querySelector(".vega-embed, marimo-vega")
+ ) {
+ requestAnimationFrame(() => {
+ window.dispatchEvent(new Event("resize"));
+ });
+ }
+ }
+ }}
+ >
+ {cellsWithOutput.map((cell) => (
+ <Slide key={cell.id}>
+ <div className="h-full w-full overflow-auto flex">
+ <div className="mo-slide-content" style={{ margin: "auto 0" }}>
+ <CellOutputSlide
+ cellId={cell.id}
+ status={cell.status}
+ output={cell.output}
+ />
+ </div>
+ </div>
+ </Slide>
+ ))}
+ </Deck>
+ <Tooltip content="Fullscreen (F)">
+ <Button
+ data-testid="marimo-plugin-slides-fullscreen"
+ variant="ghost"
+ size="icon"
+ className="absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-70 text-muted-foreground transition-opacity h-7 w-7"
+ onClick={() => {
+ deckRef.current
+ ?.getViewportElement()
+ ?.requestFullscreen()
+ .catch((error) => {
+ Logger.error("Failed to request fullscreen", error);
+ });
+ }}
+ >
+ <ExpandIcon className="h-4 w-4" />
+ </Button>
+ </Tooltip>
+ </div>
+ );
+};
+
+export default RevealSlidesComponent;
diff --git a/frontend/src/components/slides/reveal-slides.css b/frontend/src/components/slides/reveal-slides.css
new file mode 100644
index 0000000000..1c8d498083
--- /dev/null
+++ b/frontend/src/components/slides/reveal-slides.css
@@ -0,0 +1,42 @@
+@import "reveal.js/reveal.css";
+
+/* Neutralize reveal-viewport styles so the slides inherit marimo's defaults */
+.reveal-viewport {
+ background-color: transparent;
+ color: inherit;
+ line-height: inherit;
+ overflow: visible;
+ height: auto;
+}
+.reveal-viewport:fullscreen {
+ background-color: var(--background);
+}
+.reveal-viewport:fullscreen .mo-slide-content {
+ padding-left: 2rem;
+ padding-right: 2rem;
+}
+.reveal-viewport::backdrop {
+ background-color: var(--background);
+}
+
+/* Ensure .reveal inherits marimo's font/color instead of setting its own */
+.mo-slides-theme.reveal {
+ font-family: inherit;
+ font-size: inherit;
+ color: inherit;
+}
+/* Use marimo's primary color for controls and progress */
+.mo-slides-theme.reveal .controls {
+ color: var(--primary);
+}
+.mo-slides-theme.reveal .progress {
+ color: var(--primary);
+}
+
+.reveal .slides {
+ text-align: unset;
+}
+
+.reveal .slides > section {
+ height: 100%;
+}
diff --git a/frontend/src/components/slides/slides.css b/frontend/src/components/slides/slides.css
index 76a9828759..f2ed1add82 100644
--- a/frontend/src/components/slides/slides.css
+++ b/frontend/src/components/slides/slides.css
@@ -1,68 +1,3 @@
-@import "swiper/css";
-@import "swiper/css/virtual";
-@import "swiper/css/navigation";
-@import "swiper/css/pagination";
-@import "swiper/css/scrollbar";
-
-.mo-slides-theme {
- --swiper-theme-color: var(--primary);
- --swiper-pagination-color: var(--swiper-theme-color);
- --swiper-pagination-left: auto;
- --swiper-pagination-right: 8px;
- --swiper-pagination-bottom: 8px;
- --swiper-pagination-top: auto;
- --swiper-pagination-fraction-color: inherit;
- --swiper-pagination-progressbar-bg-color: rgba(0, 0, 0, 0.25);
- --swiper-pagination-progressbar-size: 4px;
- --swiper-pagination-bullet-size: 8px;
- --swiper-pagination-bullet-width: 8px;
- --swiper-pagination-bullet-height: 8px;
- --swiper-pagination-bullet-border-radius: 50%;
- --swiper-pagination-bullet-inactive-color: #000;
- --swiper-pagination-bullet-inactive-opacity: 0.2;
- --swiper-pagination-bullet-opacity: 1;
- --swiper-pagination-bullet-horizontal-gap: 4px;
- --swiper-pagination-bullet-vertical-gap: 6px;
-
- .swiper-button-prev,
- .swiper-button-next {
- height: 100%;
- top: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.1);
- opacity: 0;
- padding: 0 15px;
- transition: opacity 0.3s;
- font-weight: 900;
- margin-top: 0;
-
- --swiper-navigation-sides-offset: 0;
- --swiper-navigation-size: 20px;
-
- &.swiper-button-disabled {
- opacity: 0;
- }
-
- &:hover:not(.swiper-button-disabled) {
- opacity: 1;
- }
- }
-}
-
-@font-face {
- font-family: "swiper-icons";
- src: url("data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAA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rNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA");
- font-weight: 400;
- font-style: normal;
-}
-
-/* The swiper library adds styles to `:host` which is a global selector we use for other components,
-so we are resetting this back to initial. */
-/* 2 hosts to increase specificity */
-:host:host {
- display: initial;
-}
-
/* The slides is full width, but centers the inside content to fit the width of the content. */
.mo-slide-content {
width: 100%;
diff --git a/frontend/src/components/slides/slides-component.tsx b/frontend/src/components/slides/swiper-component.tsx
similarity index 99%
rename from frontend/src/components/slides/slides-component.tsx
rename to frontend/src/components/slides/swiper-component.tsx
index a2652e7dc9..8e0559dd55 100644
--- a/frontend/src/components/slides/slides-component.tsx
+++ b/frontend/src/components/slides/swiper-component.tsx
@@ -14,6 +14,7 @@ import { useEventListener } from "@/hooks/useEventListener";
import { useIframeCapabilities } from "@/hooks/useIframeCapabilities";
import { cn } from "@/utils/cn";
+import "./swiper-slides.css";
import "./slides.css";
interface SlidesComponentProps {
diff --git a/frontend/src/components/slides/swiper-slides.css b/frontend/src/components/slides/swiper-slides.css
new file mode 100644
index 0000000000..4bc554365a
--- /dev/null
+++ b/frontend/src/components/slides/swiper-slides.css
@@ -0,0 +1,64 @@
+@import "swiper/css";
+@import "swiper/css/virtual";
+@import "swiper/css/navigation";
+@import "swiper/css/pagination";
+@import "swiper/css/scrollbar";
+
+.mo-slides-theme {
+ --swiper-theme-color: var(--primary);
+ --swiper-pagination-color: var(--swiper-theme-color);
+ --swiper-pagination-left: auto;
+ --swiper-pagination-right: 8px;
+ --swiper-pagination-bottom: 8px;
+ --swiper-pagination-top: auto;
+ --swiper-pagination-fraction-color: inherit;
+ --swiper-pagination-progressbar-bg-color: rgba(0, 0, 0, 0.25);
+ --swiper-pagination-progressbar-size: 4px;
+ --swiper-pagination-bullet-size: 8px;
+ --swiper-pagination-bullet-width: 8px;
+ --swiper-pagination-bullet-height: 8px;
+ --swiper-pagination-bullet-border-radius: 50%;
+ --swiper-pagination-bullet-inactive-color: #000;
+ --swiper-pagination-bullet-inactive-opacity: 0.2;
+ --swiper-pagination-bullet-opacity: 1;
+ --swiper-pagination-bullet-horizontal-gap: 4px;
+ --swiper-pagination-bullet-vertical-gap: 6px;
+
+ .swiper-button-prev,
+ .swiper-button-next {
+ height: 100%;
+ top: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.1);
+ opacity: 0;
+ padding: 0 15px;
+ transition: opacity 0.3s;
+ font-weight: 900;
+ margin-top: 0;
+
+ --swiper-navigation-sides-offset: 0;
+ --swiper-navigation-size: 20px;
+
+ &.swiper-button-disabled {
+ opacity: 0;
+ }
+
+ &:hover:not(.swiper-button-disabled) {
+ opacity: 1;
+ }
+ }
+}
+
+@font-face {
+ font-family: "swiper-icons";
+ src: url("data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgy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P7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA");
+ font-weight: 400;
+ font-style: normal;
+}
+
+/* The swiper library adds styles to `:host` which is a global selector we use for other components,
+so we are resetting this back to initial. */
+/* 2 hosts to increase specificity */
+:host:host {
+ display: initial;
+}
diff --git a/frontend/src/plugins/layout/carousel/CarouselPlugin.tsx b/frontend/src/plugins/layout/carousel/CarouselPlugin.tsx
index ebe411780a..646f011d46 100644
--- a/frontend/src/plugins/layout/carousel/CarouselPlugin.tsx
+++ b/frontend/src/plugins/layout/carousel/CarouselPlugin.tsx
@@ -8,6 +8,7 @@ import swiperCssVirtual from "swiper/css/virtual?inline";
import swiperCss from "swiper/css?inline";
import { z } from "zod";
import slidesCss from "@/components/slides/slides.css?inline";
+import swiperSlidesCss from "@/components/slides/swiper-slides.css?inline";
import type {
IStatelessPlugin,
IStatelessPluginProps,
@@ -34,6 +35,7 @@ export class CarouselPlugin implements IStatelessPlugin<Data> {
swiperCssPagination,
swiperCssScrollbar,
slidesCss,
+ swiperSlidesCss,
];
render(props: IStatelessPluginProps<Data>): JSX.Element {
@@ -46,5 +48,5 @@ export class CarouselPlugin implements IStatelessPlugin<Data> {
}
const LazySlidesComponent = React.lazy(
- () => import("../../../components/slides/slides-component"),
+ () => import("../../../components/slides/swiper-component"),
);
diff --git a/marimo/_smoke_tests/carousel.py b/marimo/_smoke_tests/carousel.py
index b1a33e2b22..d8884805c5 100644
--- a/marimo/_smoke_tests/carousel.py
+++ b/marimo/_smoke_tests/carousel.py
@@ -3,29 +3,30 @@
# dependencies = [
# "marimo",
# "altair",
-# "pandas",
+# "polars",
# ]
# ///
# Copyright 2026 Marimo. All rights reserved.
import marimo
-__generated_with = "0.15.5"
-app = marimo.App()
+__generated_with = "0.23.1"
+app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
- import pandas as pd
+ import polars as pl
import altair as alt
- return alt, mo, pd
+
+ return alt, mo, pl
@app.cell
-def _(pd):
- df = pd.read_csv(
- "https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv"
+def _(pl):
+ df = pl.read_csv(
+ "https://gist.githubusercontent.com/netj/8836201/raw/6f9306ad21398ea43cba4f7d537619d0e07d5ae3/iris.csv"
)
return (df,)
@@ -41,7 +42,7 @@ def _(alt, df, mo):
chart = mo.ui.altair_chart(
alt.Chart(df)
.mark_point()
- .encode(x="sepal_length", y="sepal_width", color="species"),
+ .encode(x="sepal.length", y="sepal.width", color="variety"),
label="Iris Data in chart",
)
return (chart,)
diff --git a/marimo/_smoke_tests/slides_examples/kitchen_sink.py b/marimo/_smoke_tests/slides_examples/kitchen_sink.py
new file mode 100644
index 0000000000..8661018edc
--- /dev/null
+++ b/marimo/_smoke_tests/slides_examples/kitchen_sink.py
@@ -0,0 +1,332 @@
+import marimo
+
+__generated_with = "0.23.1"
+app = marimo.App(
+ width="medium",
+ layout_file="layouts/kitchen_sink.slides.json",
+)
+
+
+def _():
+ import marimo as mo
+
+ return (mo,)
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ # H1 Heading
+ """)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ # H1 Heading
+ ## H2 Subheading
+ """)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ # H1 Heading
+
+ This is a paragraph of prose beneath the H1 heading to see how body text sits under the title.
+ """)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ ## H2 Heading
+ """)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ ## H2 Heading
+
+ A paragraph beneath the H2 heading.
+ """)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ ## H2 Heading
+
+ - First bullet point
+ - Second bullet point
+ - Third bullet point
+ """)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ # Hi
+ """)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ ## Hi
+ """)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("# " + "A really long H1 heading that keeps on going and going " * 6)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("## " + "A really long H2 heading that keeps on going and going " * 6)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("# Centered H1").center()
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ # H1 Heading
+ ## H2 Subheading
+ """).center()
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""
+ # H1 Heading
+ ## H2 Subheading
+ """).left()
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.stat(
+ value="1,234",
+ label="Active users",
+ caption="+12% vs last week",
+ direction="increase",
+ )
+ return
+
+
[email protected](hide_code=True)
+def _():
+ import altair as _alt
+ import pandas as _pd
+
+ _chart_df = _pd.DataFrame(
+ {"x": list(range(20)), "y": [i * i for i in range(20)]}
+ )
+ _alt.Chart(_chart_df).mark_line(point=True).encode(x="x", y="y").properties(
+ width=400, height=300
+ )
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ import pandas as _pd
+
+ _df = _pd.DataFrame(
+ {
+ "name": ["Alice", "Bob", "Carol", "Dave", "Eve"],
+ "score": [92, 88, 77, 95, 81],
+ "team": ["A", "B", "A", "C", "B"],
+ }
+ )
+ mo.ui.table(_df)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.accordion(
+ {
+ "First section": mo.md("Content of the first section."),
+ "Second section": mo.md("Content of the second section."),
+ "Third section": mo.md("Content of the third section."),
+ }
+ )
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.ui.tabs(
+ {
+ "Overview": mo.md("This is the overview tab."),
+ "Details": mo.md("This is the details tab."),
+ "Settings": mo.md("This is the settings tab."),
+ }
+ )
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.hstack([mo.md("Left"), mo.md("Middle"), mo.md("Right")])
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.vstack([mo.md("Top"), mo.md("Middle"), mo.md("Bottom")])
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.hstack([mo.md("Left"), mo.md("Middle"), mo.md("Right")], widths="equal")
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.vstack([mo.md("Top"), mo.md("Middle"), mo.md("Bottom")], heights="equal")
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.vstack(
+ [
+ mo.hstack([mo.md("A"), mo.md("B"), mo.md("C")], widths="equal"),
+ mo.hstack([mo.md("D"), mo.md("E"), mo.md("F")], widths="equal"),
+ ]
+ )
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.Html(
+ "<div style='white-space: nowrap;'>"
+ + "this is a very long horizontal line that will overflow &nbsp; " * 40
+ + "</div>"
+ )
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("\n\n".join([f"Line {i + 1}" for i in range(200)]))
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ import pandas as _pd
+
+ mo.ui.table(_pd.DataFrame({"value": [42]}))
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ import pandas as _pd
+
+ _big = _pd.DataFrame({f"col_{c:02d}": list(range(100)) for c in range(100)})
+ mo.ui.table(_big)
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.image("https://picsum.photos/seed/marimo/400/300")
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.hstack(["text", mo.image("https://picsum.photos/seed/hs/200/150")])
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.vstack(["text", mo.image("https://picsum.photos/seed/vs/200/150")])
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.vstack(["# text", mo.image("https://picsum.photos/seed/vs1/200/150")])
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.vstack(["## text", mo.image("https://picsum.photos/seed/vs2/200/150")])
+ return
+
+
[email protected](hide_code=True)
+def _():
+ import anywidget as _anywidget
+ import traitlets as _traitlets
+
+
+ class _CounterWidget(_anywidget.AnyWidget):
+ _esm = """
+ function render({ model, el }) {
+ const btn = document.createElement("button");
+ btn.style.padding = "0.5rem 1rem";
+ const paint = () => { btn.innerHTML = `clicked ${model.get("value")} times`; };
+ paint();
+ btn.addEventListener("click", () => {
+ model.set("value", model.get("value") + 1);
+ model.save_changes();
+ });
+ model.on("change:value", paint);
+ el.appendChild(btn);
+ }
+ export default { render };
+ """
+ value = _traitlets.Int(0).tag(sync=True)
+
+
+ _CounterWidget()
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.iframe("https://marimo.io/")
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.Html(
+ "<div style='padding: 1rem; border: 2px solid #8b5cf6; border-radius: 8px; background: #f5f3ff;'>Custom HTML content via <code>mo.Html</code></div>"
+ )
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/marimo/_smoke_tests/slides_examples/layouts/kitchen_sink.slides.json b/marimo/_smoke_tests/slides_examples/layouts/kitchen_sink.slides.json
new file mode 100644
index 0000000000..af4970a3d7
--- /dev/null
+++ b/marimo/_smoke_tests/slides_examples/layouts/kitchen_sink.slides.json
@@ -0,0 +1,4 @@
+{
+ "type": "slides",
+ "data": {}
+}
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f619a80390..d9c270ef87 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -181,6 +181,9 @@ importers:
'@replit/codemirror-vim':
specifier: ^6.3.0
version: 6.3.0(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])
+ '@revealjs/react':
+ specifier: ^0.2.1
'@streamdown/math':
specifier: ^1.0.1
version: 1.0.1([email protected])
@@ -397,6 +400,9 @@ importers:
remark-gfm:
specifier: ^4.0.1
version: 4.0.1
+ reveal.js:
+ specifier: ^6.0.0
+ version: 6.0.0
rpc-anywhere:
specifier: ^1.7.0
version: 1.7.0
@@ -3592,6 +3598,13 @@ packages:
'@codemirror/state': 6.x.x
'@codemirror/view': 6.x.x
+ '@revealjs/[email protected]':
+ resolution: {integrity: sha512-bEivSQ1W0WpiSUPd4KNLkFGSkdywuno2jjzBHQCO+SN3ChFWP6Y3Z2OLRih3Qeel5k1bwKsSsmr5AMUMA5ZdyQ==}
+ peerDependencies:
+ react: ^19.2.4
+ react-dom: ^19.2.4
+ reveal.js: '>=5'
+
'@rolldown/[email protected]':
resolution: {integrity: sha512-Ok9V8o7o6YfSdTTYA/uHH30r3YtOxLD6G3wih/U9DO0ucBBFq8WPt/DslU53OgfteLRHITZny9N/qCUxMf9kjQ==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -8401,6 +8414,9 @@ packages:
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
+ resolution: {integrity: sha512-RayDr1FL3Jglnf6p9xHGJ0U18va96PiuLs/JHnd1cdDOXvC+3lsXKe6ujl7PX0pvnhNW2Tpqnr6PEKpJVO2exw==}
+
resolution: {integrity: sha512-DA8+YS+sMIVpbsuKgy+Z67L9Lxb1p05mNxRpDPNksPDEFir4vmBlUtuN9jkTGn9YMMdlBuK7XQgFiz6ws+yhSg==}
@@ -13593,6 +13609,12 @@ snapshots:
'@codemirror/state': 6.6.0
'@codemirror/view': 6.41.0
+ dependencies:
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+ reveal.js: 6.0.0
+
'@rolldown/[email protected]':
optional: true
@@ -19163,6 +19185,8 @@ snapshots:
+