Skip to main content

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,
    default_filters=[
        {"column": "status", "operation": "equals", "value": "active"},
    ],
    default_sort={"column": "score", "direction": "desc"},
    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.

Use default_filters and default_sort to set the table's initial operations. default_filters accepts the same column, operation, and value shape as the filter menu; default_sort accepts one column and direction ("asc" or "desc"). Resetting the Default view restores these defaults.

Filter operations and controls follow each pandas column's semantic dtype. Text columns provide text matching, ordered numeric and temporal columns provide comparisons and inclusive between, booleans use a true/false selector, and bounded categoricals support in and notIn. Range filters use {"lower": "...", "upper": "..."} as their value, while categorical set filters use a list of values. Date and datetime values use ISO syntax:

default_filters=[
    {
        "column": "created_at",
        "operation": "between",
        "value": {
            "lower": "2026-01-01T00:00:00",
            "upper": "2026-01-31T23:59:59",
        },
    },
]

Versioned outputs

Wrap a rich notebook value with ui.version() to keep earlier successful renders inside the saved notebook output:

t = 5
filtered = df[df > t]

ui.version(filtered.plot())

After the cell runs more than once, hover the output and use the version picker in its upper-right corner. Orion retains the latest 10 versions by default:

ui.version(filtered.plot(), max_versions=5)

Unkeyed wrappers are matched by their order among the versioned outputs in the cell. Add a unique key when a cell contains several versioned outputs that may be reordered:

ui.version(revenue_plot, key="revenue")
ui.version(retention_plot, key="retention")

Failed reruns keep the last successful version history alongside the error. Clearing the output clears its history. Self-contained rich MIME outputs remain available after saving and reopening the notebook; live widgets and kernel-backed controls can still require an active kernel.

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.

License

Apache-2.0

Metadata

Release files for orion-ui 0.20.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orion-ui 0.20.2
File Size Uploaded
orion_ui-0.20.2.tar.gz 35.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for orion-ui 0.20.2
File Interpreter ABI Platform
orion_ui-0.20.2-py3-none-any.whl Python 3 none any Details

Total release size: 69.0 kB

Release files / orion_ui-0.20.2.tar.gz

Download URL orion_ui-0.20.2.tar.gz
Size 35.2 kB
Tags Source
SHA-256 checksum
How to use checksums
560cb050792a61218bc55a899211d7e37e5a1ce2ca9fb05467037008f100e6eb
BLAKE2b-256 checksum
How to use checksums
3fb9c07914e2cdebd9617a8bbe651b550b4cd15b9007a720f0f471237507ab10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / orion_ui-0.20.2-py3-none-any.whl

Download URL orion_ui-0.20.2-py3-none-any.whl
Size 33.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b72b4440b6b7657f1c99791e2d48ff581b66b815db691e52a6eded05396a4c1
BLAKE2b-256 checksum
How to use checksums
d0e8c7f70234af24ec1ffc4bd549a7a26cd2832eed33993186ced266660e602f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.20.2 This release

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.1

2 release files

0.18.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page