Get help from the marimo community

Updated 4 days ago

ui element value

Plain Text
@app.cell
def input_cell(mo):
    my_input = mo.ui.text()
    my_input
    return (my_input,)


@app.cell
def result_cell(my_input):
    my_input.value
    return


If I run input_cell, the result_cell will immediately be run after that (because my_input.value). I know that we can change the default value or use callback functions, but it could be a good idea to prevent dependent cells do not run and wait for the users actual input.
M
H
7 comments
you can use a form for that
mo.ui.text().form()
Thank you for your response. Still the result_cell will run immediately and output None. it's kind of using mo.ui.text() with default value of None
are you using the form?
Yes, the cell dependent cell runs without waiting.
https://marimo.app/l/br1xly
Just the first time. You can use mo.stop to and check if the output is None to stop further cells from rendering
Add a reply
Sign up and join the conversation on Discord