Calmcode - marimo: ui

Reactive UI via Marimo

1 2 3 4 5 6 7

Lets update the first cell to include a user interface.

import marimo as mo

x = mo.ui.slider(1, 10, 0.1)
x

When you run this cell you will now see a slider appear. However, that also means that x is now pointing to a slider object. If you want to see the value of the slider you can do so by running the following cell.

x.value

This will show you the current value of the slider. That also means that we need to update our aforementioned formula from x + y to x.value + y.

But note how everything still updates in the same way!