Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
marimo
Light Logo Dark Logo
  • Getting Started
  • Guides
    • Overview
    • Running marimo with uv
    • Globally Installed Tool
    • Reactive execution
    • Interactive elements
    • Visualizing outputs
    • Expensive notebooks
    • Coming from Jupyter
    • Working with data
      • Using SQL
      • Interactive dataframes
      • Plotting
    • Editor features
      • Editor overview
      • Package management
      • AI completion
      • Hotkeys
    • Configuration
      • Runtime configuration
      • Theming
      • Custom HTML Head
    • Run as an app
    • Run as a script
    • Coming from other tools
      • Coming from Streamlit
      • Coming from Jupytext
      • Coming from Papermill
    • Integrating with marimo
      • Richly display objects
      • Building custom UI elements
    • Reactive state
    • Online playground
    • Exporting to HTML and other formats
    • Deploying
    • Best practices
    • Troubleshooting
  • Recipes
  • API Reference
    • Markdown
    • Inputs
      • Array
      • Batch
      • Button
      • Chat
      • Checkbox
      • Code Editor
      • Data Explorer
      • Dataframe
      • Dates
      • Dictionary
      • Dropdown
      • File
      • File Browser
      • Form
      • Microphone
      • Multiselect
      • Navigation Menu
      • Number
      • Radio
      • Range Slider
      • Refresh
      • Run Button
      • Slider
      • Switch
      • Table
      • Tabs
      • Text
      • Text Area
      • Building custom UI elements
    • Layouts
      • Accordion
      • Carousel
      • Callout
      • Justify
      • Lazy
      • Plain
      • Routes
      • Sidebar
      • Stacks
      • Tree
    • Plotting
    • Media
      • Image
      • Audio
      • Video
      • PDF
      • Download Media
      • Plain text
    • Diagrams
    • Status
    • Outputs
    • Control flow
    • HTML
    • Query Parameters
    • Command Line Arguments
    • Caching
    • State
    • App
    • Cell
    • Miscellaneous
  • FAQ
  • Examples
  • Integrations
    • MotherDuck
    • Google Cloud Storage
    • Google Cloud BigQuery
    • Google Sheets
  • Community

Links

  • GitHub
  • Gallery
  • Discord
  • Newsletter
  • Twitter
  • Bluesky
  • Awesome marimo
  • Marimo Cloud Waitlist
  • Blog
Back to top
View this page
Edit this page

Sidebar¶

marimo.sidebar(item: object, footer: object | None = None) → None¶

Displays content in a sidebar. This is a special layout component that will display the content in a sidebar layout, rather than below/above the cell.

This component still needs to be the last expression in the cell, in order to display correctly.

You may use more than one mo.sidebar - they will be displayed in the order they are called.

Examples.

mo.sidebar(
    [
        mo.md("# marimo"),
        mo.nav_menu(
            {
                "#home": f"{mo.icon('lucide:home')} Home",
                "#about": f"{mo.icon('lucide:user')} About",
                "#contact": f"{mo.icon('lucide:phone')} Contact",
                "Links": {
                    "https://twitter.com/marimo_io": "Twitter",
                    "https://github.com/marimo-team/marimo": "GitHub",
                },
            },
            orientation="vertical",
        ),
    ]
)

Args.

  • item: the content to display in the sidebar

  • footer: the content to display at the bottom of the sidebar

Returns.

  • An Html object.

Next
Stacks
Previous
Routes
Copyright © 2024, marimo-team
Made with Sphinx and @pradyunsg's Furo
On this page
  • Sidebar
    • sidebar()