Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions marimo/_plugins/ui/_core/ui_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ class UIElement(Html, Generic[S, T]):

**Attributes.**

- value: The value of the `UIElement`.
- value: The current value of the `UIElement`. Read-only; it reflects
frontend state and can't be assigned directly. If you need to
imperatively drive UI state, use `mo.state()`.

**Methods.**

Expand Down Expand Up @@ -310,7 +312,12 @@ def _register_as_view(self, parent: UIElement[Any, Any], key: str) -> None:

@property
def value(self) -> T:
"""The element's current value."""
"""The element's current value.

Read-only; marimo updates it when the UI element changes in the
frontend. If you need to imperatively drive UI state, use
`mo.state()` instead of assigning to this property.
"""
if self._ctx is None:
return self._value

Expand Down
Loading