Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

update anywidget docs (#1969)

Akshay Agrawal07e9bb1bde4c
diff --git a/docs/api/inputs/anywidget.md b/docs/api/inputs/anywidget.md
index df6d558948..bee88cf32f 100644
--- a/docs/api/inputs/anywidget.md
+++ b/docs/api/inputs/anywidget.md
@@ -3,7 +3,35 @@
Build custom UI plugins that hook into marimo's reactive
execution engine by using [anywidget](https://anywidget.dev/).
-[anywidget](https://anywidget.dev/) is a Python library and specification for creating custom Jupyter-compatible widgets. marimo supports anywidget, allowing you to import anywidget widgets or create your own custom widgets and use them in your notebooks and apps.
+[anywidget](https://anywidget.dev/) is a Python library and specification for
+creating custom Jupyter-compatible widgets. marimo supports anywidget, allowing
+you to import anywidget widgets or create your own custom widgets and use them
+in your notebooks and apps.
+
+## Importing a widget
+
+You can use anywidgets that others have built, such as
+[quak](https://github.com/manzt/quak) or
+[drawdata](https://github.com/koaning/drawdata), directly in marimo.
+
+Here is an example using `drawdata`:
+
+```python
+# pip install drawdata
+from drawdata import ScatterWidget
+
+widget = mo.ui.anywidget(ScatterWidget())
+
+# In another cell, you can access the widget's value
+widget.value
+
+# You can also access the widget's specific properties
+widget.data
+widget.data_as_polars
+```
+
+For additional examples, see
+[our repo](https://github.com/marimo-team/marimo/tree/main/examples/anywidget).
## Custom widget
@@ -56,22 +84,6 @@ widget.value
widget.count
```
-## Importing a widget
-
-```python
-# pip install drawdata
-from drawdata import ScatterWidget
-
-widget = mo.ui.anywidget(ScatterWidget())
-
-# In another cell, you can access the widget's value
-widget.value
-
-# You can also access the widget's specific properties
-widget.data
-widget.data_as_polars
-```
-
---
```{eval-rst}