mo.ui.checkbox
Create a checkbox for boolean input.Signature
Parameters
Initial checked state
Markdown label for the checkbox
Whether the checkbox is disabled
Learn more about Mintlify
Enter your email to receive updates about new features and product releases.
Boolean checkbox input
mo.ui.checkbox(
value: bool = False,
*,
label: str = "",
disabled: bool = False,
on_change: Callable[[bool], None] | None = None
)
import marimo as mo
# Basic checkbox
agree = mo.ui.checkbox(label="I agree to the terms")
agree
# Use the value
if agree.value:
mo.md("Thank you for agreeing!")
# Multiple checkboxes
options = mo.md(
f"""
Select your preferences:
{mo.ui.checkbox(label="Email notifications")}
{mo.ui.checkbox(label="SMS alerts")}
{mo.ui.checkbox(label="Newsletter")}
"""
)