Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Fullscreen

Wrap a widget with an expand button that opens a viewport-covering overlay — either the same widget expanded, or a different layout (e.g. inline a single chart, fullscreen a whole dashboard). Close with the ✕ button or Esc.

Import

from manywidgets import Fullscreen

Example

Expand a chart to fill the screen:

Show a different layout in fullscreen — inline a single stat, fullscreen a dashboard:

Open and close it from Python:

API

TraitTypeDefaultDescription
childInstance—Widget rendered inline (with the expand button).
fullscreenInstance—Optional alternate widget shown in the overlay instead of the child.
is_openBoolFalseWhether the fullscreen overlay is open (settable from Python).
widget_idUnicode''Stable unique id used for cross-widget linking (auto-assigned).

On a statically exported page, the overlay state is mirrored into the URL: opening fullscreen adds ?fullscreen=<widget_id> to the address bar, so you can copy the URL to share a link that opens the page directly in that fullscreen view. A bare ?fullscreen=true opens the page’s first Fullscreen widget.

Auto-assigned ids (fullscreen_1, …) depend on widget creation order, so pass an explicit id for links that should survive notebook edits:

Fullscreen(chart, fullscreen=dashboard, widget_id="ndvi-dashboard")
# share as: https://example.org/report.html?fullscreen=ndvi-dashboard

Notes

  • The overlay is a CSS layer covering the viewport (not the browser’s fullscreen mode), so it works in static export and can be driven from Python.

  • A directly-expanded child (no fullscreen= layout) stretches to fill the overlay. Inside a fullscreen= layout, children keep their own sizing and the panel scrolls — give that layout its own heights (e.g. a map’s height trait) rather than expecting it to stretch.

  • The same widget instance can appear both inline and in the fullscreen= layout — the inline view is hidden while the overlay is open, and trait changes stay in sync between the two.

See the fullscreen dashboard example for a lonboard map + chart + controls layout behind a single inline chart.