orion-ui
Python library for building interactive notebook UI in Orion. Author controls in a code cell with import orion_ui as ui; Orion renders them as native notebook outputs.
This package is separate from orion-notebook (the orion CLI). Install orion-ui into the same Python environment as your notebook kernel.
Install
pip install orion-ui
Orion managed runtime
If you start Orion with orion and use its managed Jupyter environment (~/.orion/runtime/venv on macOS/Linux, %USERPROFILE%\.orion\runtime\venv on Windows), orion-ui is installed automatically. You do not need a separate install.
External kernel (conda, venv, your own Jupyter)
Install into that kernel's Python:
python -m pip install orion-ui
Then restart the notebook kernel and re-run your cells.
Quick example
Put a component tree as the last expression in a code cell:
import orion_ui as ui
ui.card(
ui.stack(
ui.select("model", ["gpt-4.1", "claude-sonnet"], label="Model", default_value="gpt-4.1"),
ui.slider("temperature", label="Temperature", min=0, max=2, default_value=0.7, step=0.1),
),
title="Controls",
class_name="controls-card",
)
Read values in later cells:
model = ui.get("model")
temperature = ui.get("temperature")
Run cells when a control changes
Every user-editable, state-bound control accepts an optional on_change
action. Target cells must already have stable Orion cell ids:
ui.date_picker(
"start_date",
label="Start date",
on_change={
"type": "execute_cells",
"cellIds": ["stable-orion-cell-id"],
},
)
Orion writes the new value to Python state before running the target cells.
Selections, presets, and keyboard nudges run immediately. Typing waits 500 ms
after the latest edit, while slider and date-range dragging wait 250 ms. Use
debounce_ms=0 for immediate execution or another non-negative millisecond
value to override the default. Date ranges run only after both endpoints are
selected, and ui.date_time_picker() applies one action to its date, start
time, and end time values.
The supported controls are ui.input, ui.textarea, ui.select,
ui.slider, ui.checkbox, ui.switch, ui.radio_group, ui.toggle,
ui.toggle_group, ui.calendar, ui.date_picker,
ui.date_range_slider, and ui.date_time_picker. Prefer an explicit
ui.button(..., action=...) when running cells is expensive or destructive.
DataFrame tables
Use ui.table() for interactive pandas DataFrame browsing without sending the
entire DataFrame to the frontend:
import orion_ui as ui
ui.table(
df,
source="df",
page_size=50,
column_descriptions={
"score": "Priority score from 1 to 10.",
"status": "Current account status.",
},
)
Table filtering, sorting, grouping, stats, and export requests run in the Python kernel. Saved table views are stored on the notebook output metadata as structured operations plus a readable pandas expression. Column descriptions, when provided, appear as info-icon tooltips in table headers.
class_name adds semantic CSS hooks for Orion UI in Notebook View and App View. Do not write CSS into notebook metadata; if a notebook needs custom styling, include it in the relevant cell source/output and scope selectors to rendered markdown/output areas. Orion also exposes JupyterLab-compatible rendered-content selectors such as .jp-MarkdownOutput, .jp-RenderedHTMLCommon, and .jp-OutputArea-output for cell-authored styles. Do not rely on arbitrary Tailwind classes generated at runtime.
Requirements
- Python 3.8+
- Orion (or another frontend that renders
application/vnd.orion.ui+json) for interactive display
Other Jupyter frontends may show a static fallback instead of live controls.
Version coupling
Pin orion-ui to the same version as your Orion app when using managed runtimes (for example orion-ui==0.6.0). The Python output format and Orion's renderer are released together.
Links
- Orion website
- User docs
- Fix: orion_ui import error
- orion-notebook on PyPI (CLI launcher)
License
Apache-2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file orion_ui-0.15.0.tar.gz.
File metadata
- Download URL: orion_ui-0.15.0.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee581e7e8d843887b6cadb3da25f65ae4c3ac027adb90c07acb03a1377e6f9d2
|
|
| MD5 |
777b9dc8182aeb18c6ee9e0e472f842c
|
|
| BLAKE2b-256 |
ed25bc18f1b5f4109315e8fe191a7a1338c49f21f65437bc514d2f0a55bbf991
|
File details
Details for the file orion_ui-0.15.0-py3-none-any.whl.
File metadata
- Download URL: orion_ui-0.15.0-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f1cbe2ef934a401f4524344dfb639adfc79fa5138bb192c1248e8705f9ef8e9
|
|
| MD5 |
fe5d734bdcd82038f4551f97308d3c48
|
|
| BLAKE2b-256 |
045275c3c0103c8f8c7c002c1cd20b599162a24e67a7f462b1fce168068e1043
|