Skip to content

Navigate

To navigate to another page, you can use me.navigate. This is particularly useful for navigating across a multi-page app.

Example

import mesop as me


def navigate(event: me.ClickEvent):
  me.navigate("/about")


@me.page(path="/")
def home():
  me.text("This is the home page")
  me.button("navigate to about page", on_click=navigate)


@me.page(path="/about")
def about():
  me.text("This is the about page")

API

navigate

Navigates to the given URL.

PARAMETER DESCRIPTION
url

The URL to navigate to.

TYPE: str