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.

docs: fix example for marimo.ui.file_browser (#1774)

Nicolas Chachereauef4b6a7ee058
diff --git a/marimo/_plugins/ui/_impl/input.py b/marimo/_plugins/ui/_impl/input.py
index b5f19e07fe..003756fe55 100644
--- a/marimo/_plugins/ui/_impl/input.py
+++ b/marimo/_plugins/ui/_impl/input.py
@@ -1295,13 +1295,15 @@ class file_browser(UIElement[List[Dict[str, Any]], Sequence[FileInfo]]):
Selecting multiple files:
```python
- file_browser = mo.ui.file_browser(path="path/to/dir", multiple=True)
+ file_browser = mo.ui.file_browser(
+ initial_path="path/to/dir", multiple=True
+ )
# Access the selected file path(s):
- file_browser.value[index]
-
- # Or:
file_browser.path(index)
+
+ # Get name of selected file(s)
+ file_browser.name(index)
```
**Attributes.**