Queue a UI element value update. Triggers reactive re-execution the same way a user interaction would. Updates are flushed as a single batch on context exit. Examples: ```python slider = ctx.globals["my_slider"] ctx.set_ui_value(slider, 4
(self, element: Any, value: Any)
| 1798 | # ------------------------------------------------------------------ |
| 1799 | |
| 1800 | def set_ui_value(self, element: Any, value: Any) -> None: |
| 1801 | """Queue a UI element value update. |
| 1802 | |
| 1803 | Triggers reactive re-execution the same way a user interaction |
| 1804 | would. Updates are flushed as a single batch on context exit. |
| 1805 | |
| 1806 | Examples: |
| 1807 | ```python |
| 1808 | slider = ctx.globals["my_slider"] |
| 1809 | ctx.set_ui_value(slider, 42) |
| 1810 | |
| 1811 | dropdown = ctx.globals["color_picker"] |
| 1812 | ctx.set_ui_value(dropdown, "red") |
| 1813 | ``` |
| 1814 | |
| 1815 | Args: |
| 1816 | element: A marimo UI element (e.g. `mo.ui.slider`). |
| 1817 | value: The new value, matching the type the element expects. |
| 1818 | """ |
| 1819 | self._require_entered() |
| 1820 | self._ui_updates.append((UIElementId(element._id), value)) |
| 1821 | |
| 1822 | # ------------------------------------------------------------------ |
| 1823 | # Low-level primitives |
nothing calls this directly
no test coverage detected