marimo
marimo copied to clipboard
feat: mo.routes()
trafficstars
This adds mo.routes to change the layout based on the url hash or pathname
@app.cell
def __():
mo.routes({
"#/home": mo.md("# Home"),
"#/about": mo.md("# About"),
"#/contact": mo.md("# Contact"),
})
return
@app.cell
def __():
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",
),
]
)
return
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| marimo-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 22, 2024 2:06pm |
| marimo-storybook | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 22, 2024 2:06pm |
@akshayka
- The first is the weakref issue in pretty sure. We can more lazy as the under the hood implementation but it's loses a lot of its benefit
- I can add a catch all route as an example - maybe I'll make it constant that is easy to access
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.6.1-dev29