Skip to content

Orion UI component reference

Reference for Python helpers from import orion_ui as ui. Put the final ui.* expression as the last line of a code cell so Orion displays the UI output.

For workflows, state rules, and examples, see Orion UI (orion_ui).

Shared parameters

These arguments appear on many helpers. Allowed values match what Orion's renderer accepts.

Layout spacing

ParameterAllowed valuesDefault
gap"none", "xs", "sm", "md", "lg""md"
padding"none", "sm", "md", "lg""md"
align"start", "center", "end", "stretch""stretch"
columns1, 2, 3, or 4 (other values fall back to 2 columns)2

Styling hook

ParameterTypeNotes
class_namestr or NoneSemantic CSS hook (for example "metric-card"). Define matching rules in metadata.orion.appView.css. Default is None.

Control state

Most interactive controls take a key (non-empty string) and bind to Python runtime state via ui.get(), ui.set(), and ui.state().

ParameterTypeNotes
keystrRequired on controls. Must not be empty.
labelstr or NoneVisible field label. Default is None.
default_valuevariesInitial value when no runtime state exists yet.
valueomitted or scalarWhen omitted, registers the default without overwriting user input on rerun. When provided, must be a str, int, float, or bool and forces that value on rerun.
optionslist of str or dictEach entry may be a string (label and value) or a dict with "value" and optional "label".

Option lists (select, radio_group, toggle_group)

When default_value is None, the first option's value is selected initially.

Date and time values

ControlStored format
Single date (mode="single")ISO string "YYYY-MM-DD"
Date range (mode="range")JSON string, for example '{"from":"2026-06-01","to":"2026-06-07"}'
Time inputs (date_time_picker)"HH:MM:SS" on separate state keys

Date presets

Pass presets as a list of dicts. Each preset must include "label" and may include:

  • "value" — fixed ISO date
  • "from", "to" — fixed range endpoints
  • "daysOffset" — single date relative to today
  • "fromDaysOffset", "toDaysOffset" — range relative to today

Example:

python
presets=[{"label": "Today", "daysOffset": 0}]

Button actions

ParameterShape
action{"type": "execute_cells", "cellIds": ["stable-orion-cell-id"]}

cellIds must reference existing cells[i].metadata.orion.id values in the notebook.


Layout and containers

ui.page(*children, gap="md", padding="md", class_name=None)

Top-level page container.

ParameterAllowed values / typeDefault
*childrenComponents or plain strings (strings become labels)
gapSee layout spacing"md"
paddingSee layout spacing"md"
class_nameSee styling hookNone

ui.stack(*children, gap="md", align="stretch", class_name=None)

Vertical stack layout.

ParameterAllowed values / typeDefault
*childrenComponents or plain strings
gapSee layout spacing"md"
alignSee layout spacing"stretch"
class_nameSee styling hookNone

ui.grid(*children, columns=2, gap="md", class_name=None)

Responsive grid layout.

ParameterAllowed values / typeDefault
*childrenComponents or plain strings
columns1, 2, 3, or 42
gapSee layout spacing"md"
class_nameSee styling hookNone

ui.section(*children, title=None, description=None, gap="md", padding="md", class_name=None)

Titled section with optional description.

ParameterAllowed values / typeDefault
*childrenComponents or plain strings
titlestr or NoneNone
descriptionstr or NoneNone
gapSee layout spacing"md"
paddingSee layout spacing"md"
class_nameSee styling hookNone

ui.card(*children, title=None, description=None, gap="md", class_name=None)

Framed card container.

ParameterAllowed values / typeDefault
*childrenComponents or plain strings
titlestr or NoneNone
descriptionstr or NoneNone
gapSee layout spacing"md"
class_nameSee styling hookNone

ui.tabs(*children, default_value=None, class_name=None)

Tabbed container; each child is a tab panel.

ParameterAllowed values / typeDefault
*childrenTab panel components or plain strings
default_valuestr or None — must match a child tab value when setNone (first tab)
class_nameSee styling hookNone

ui.accordion(*children, default_value=None, multiple=False, class_name=None)

Expandable accordion; each child becomes an item.

ParameterAllowed values / typeDefault
*childrenAccordion item components or plain strings
default_valuestr or None — initially expanded item; when None, first item opensNone
multiplebool — allow more than one open itemFalse
class_nameSee styling hookNone

ui.collapsible(*children, label=None, title=None, default_open=False, content=None, description=None, class_name=None)

Single collapsible section.

ParameterAllowed values / typeDefault
*childrenContent shown when expanded
labelstr or None — trigger label when title is not setNone
titlestr or None — trigger label (preferred over label)None
default_openboolFalse
contentstr or None — inline body when no childrenNone
descriptionstr or None — supporting text with contentNone
class_nameSee styling hookNone

Carousel; each child becomes a slide.

ParameterAllowed values / typeDefault
*childrenSlide components or plain strings
orientation"horizontal" or "vertical""horizontal"
show_controlsboolTrue
class_nameSee styling hookNone

ui.separator(class_name=None)

Horizontal rule.

ParameterAllowed values / typeDefault
class_nameSee styling hookNone

Controls

ui.input(key, label=None, default_value="", value=<unset>, placeholder=None, input_type="text", class_name=None)

Text input bound to Python state. Also accepts shared control parameters above.

ParameterAllowed values / typeDefault
default_valuestr""
placeholderstr or NoneNone
input_typeHTML input type, for example "text", "email", "password", "number""text"

ui.textarea(key, label=None, default_value="", value=<unset>, placeholder=None, class_name=None)

Multi-line text input. default_value is "".

ui.select(key, options, label=None, default_value=None, value=<unset>, placeholder=None, class_name=None)

Dropdown select. See option lists and shared control parameters.

ui.slider(key, label=None, min=0, max=100, default_value=0, value=<unset>, step=1, class_name=None)

Numeric slider.

ParameterAllowed values / typeDefault
minint or float0
maxint or float100
default_valueint or float0
stepint or float1

ui.checkbox(key, label=None, default_value=False, value=<unset>, class_name=None)

Checkbox. default_value is bool, default False.

ui.switch(key, label=None, default_value=False, value=<unset>, class_name=None)

On/off switch. default_value is bool, default False.

ui.radio_group(key, options, label=None, default_value=None, value=<unset>, class_name=None)

Mutually exclusive radio buttons. See option lists.

ui.toggle(key, label=None, default_value=False, value=<unset>, variant=None, class_name=None)

Boolean toggle button.

ParameterAllowed values / typeDefault
default_valueboolFalse
variant"default", "outline" (unrecognized → "default")None

ui.toggle_group(key, options, label=None, default_value=None, value=<unset>, variant=None, class_name=None)

Exclusive toggle button group. See option lists. variant: "default" or "outline".

ui.calendar(key, label=None, mode="single", default_value="", value=<unset>, caption_layout=None, from_year=None, to_year=None, number_of_months=None, show_outside_days=False, presets=None, class_name=None)

Inline calendar. See date and time values and date presets.

ParameterAllowed values / typeDefault
mode"single" or "range" (other values → "single")"single"
default_valuestr in the format expected by mode""
caption_layout"buttons", "dropdown", "dropdown-buttons"None
from_yearint or NoneNone
to_yearint or NoneNone
number_of_monthspositive int or NoneNone
show_outside_daysbool — show adjacent-month days in week rowsFalse
presetslist of preset dicts or NoneNone

"dropdown" shows month/year selects. "dropdown-buttons" adds previous/next month buttons alongside the selects.

ui.date_picker(key, label=None, mode="single", default_value="", value=<unset>, placeholder=None, caption_layout=None, from_year=None, to_year=None, number_of_months=None, show_outside_days=False, presets=None, class_name=None)

Popover date picker. Accepts the same date parameters as ui.calendar, plus:

ParameterAllowed values / typeDefault
placeholderstr or None — trigger text when empty; renderer defaults to "Pick a date" or "Pick a date range"None

ui.date_time_picker(key, label=None, default_value="", value=<unset>, start_time_key=None, end_time_key=None, start_time_label="Start time", end_time_label="End time", default_start_time="09:00:00", default_end_time="17:00:00", caption_layout=None, from_year=None, to_year=None, show_outside_days=False, presets=None, class_name=None)

Date picker with start and end time inputs. Date uses key ("YYYY-MM-DD"). Times use separate keys as "HH:MM:SS" strings.

ParameterAllowed values / typeDefault
start_time_keystr or None"{key}_start_time"
end_time_keystr or None"{key}_end_time"
start_time_labelstr"Start time"
end_time_labelstr"End time"
default_start_timestr ("HH:MM:SS")"09:00:00"
default_end_timestr ("HH:MM:SS")"17:00:00"
caption_layout"buttons", "dropdown", "dropdown-buttons"None
from_year, to_yearint or NoneNone
show_outside_daysboolFalse
presetslist of preset dicts or NoneNone

ui.button(label, action=None, variant=None, size=None, class_name=None)

Button with optional cell-run action.

ParameterAllowed values / typeDefault
labelstr
actionSee button actions, or NoneNone
variant"default", "secondary", "outline", "ghost", "destructive"None
size"default", "sm", "lg"None
class_nameSee styling hookNone

Example:

python
ui.button(
    "Run analysis",
    action={"type": "execute_cells", "cellIds": ["your-cell-id"]},
)

Display

ui.label(text, class_name=None)

ParameterAllowed values / typeDefault
textstr
class_nameSee styling hookNone

ui.badge(text, variant=None, class_name=None)

ParameterAllowed values / typeDefault
textstr
variant"default", "secondary", "destructive", "outline"None
class_nameSee styling hookNone

ui.alert(*children, title=None, description=None, text=None, variant=None, class_name=None)

ParameterAllowed values / typeDefault
*childrenOptional child components or plain strings
titlestr or NoneNone
descriptionstr or NoneNone
textstr or None — alias for descriptionNone
variant"default", "destructive"None
class_nameSee styling hookNone

ui.progress(key=None, label=None, default_value=0, value=<unset>, max=100, class_name=None)

ParameterAllowed values / typeDefault
keystr or None — when set, binds to runtime state; when None, static barNone
labelstr or NoneNone
default_valueint or float0
valueSee control state — only applies when key is setomitted
maxint or float (100% fill)100
class_nameSee styling hookNone

ui.avatar(src=None, alt=None, fallback=None, label=None, size=None, class_name=None)

ParameterAllowed values / typeDefault
srcstr or None — image URLNone
altstr or NoneNone
fallbackstr or None — shown when image missingNone
labelstr or None — fallback aliasNone
size"sm", "md", "lg"None ("md")
class_nameSee styling hookNone

ui.popover(*children, label=None, trigger=None, text=None, content=None, description=None, class_name=None)

Popover with button trigger. trigger is preferred over label and text for the trigger label.

ui.hover_card(*children, label=None, trigger=None, text=None, content=None, description=None, class_name=None)

Hover card with link-style trigger. Same trigger/content props as ui.popover.

ui.tooltip(*children, label=None, trigger=None, text=None, content=None, description=None, class_name=None)

Tooltip on a button trigger. text and content set tooltip body; trigger sets the button label.

ui.markdown_cell(cell_id=None, text=None, class_name=None)

ParameterAllowed values / typeDefault
cell_idstr or None — Orion cell id (cells[i].metadata.orion.id)None
textstr or None — inline markdown when cell_id is not setNone
class_nameSee styling hookNone

ui.output(cell_id, output_index=0, class_name=None)

Embed another cell's rendered output.

ParameterAllowed values / typeDefault
cell_idstr — Orion cell id
output_indexint — zero-based index into that cell's outputs0
class_nameSee styling hookNone

State API

FunctionParametersReturns
ui.get(key, default=None)key: str. default: str, int, float, bool, or None.Current value, or default when unset.
ui.state()Shallow copy of all bound state as a dict.
ui.define_default(key, default)key: non-empty str. default: str, int, float, or bool.Current value (existing state or newly set default). Does not overwrite user selections.
ui.set(key, value)key: non-empty str. value: str, int, float, or bool.None. Replaces runtime state intentionally.

Use default_value= on controls for normal defaults. Use value= only when you want to force or reset state on rerun. Do not use ui.set() to define component defaults unless you mean to replace state.


Plotly styling

ui.theme.plotly(name="orion", set_default=True)

Register an Orion-styled Plotly template.

ParameterAllowed values / typeDefault
namestr — template name in plotly.io.templates"orion"
set_defaultbool — set as plotly.io.templates.defaultTrue

Returns the template dict. Raises ImportError if Plotly is not installed.

Call before creating Plotly figures:

python
ui.theme.plotly()

See Plotly version compatibility if charts fail to render.

Charts

Use Plotly, Altair, Vega-Lite, or your usual plotting libraries for charts. Orion UI primitives are for controls and layout, not chart rendering.


Last updated May 2026.

Apache-2.0 Licensed