Omni.UI.CoreUI (Omni UI v0.1.0)

Copy Markdown View Source

Shared UI primitives used across the Omni.UI component kit.

Imported automatically by use Omni.UI. These are general-purpose layout and control components (panels, selects, notifications) used by both the chat pipeline and the surrounding chrome (sessions sidebar, files panel).

Summary

Functions

Collapsible section with an icon and optional toggle label.

Stacked toaster for in-app notifications.

Flex column layout with a header and scrollable body.

Three-column header bar with a title and optional left/right action slots.

Dropdown select with support for grouped options.

Formatted time display with tooltip showing full date.

Compact display of token counts and cost.

Prev/next navigation with position indicator (e.g. "2/3").

Functions

expandable(assigns)

Collapsible section with an icon and optional toggle label.

Attributes

  • label (:string) - text shown as the toggle label when no :toggle slot is given. Defaults to nil.

Slots

  • icon (required) - shown when collapsed; replaced by a chevron on hover or when expanded.
  • toggle - content shown as the clickable toggle; overrides :label.
  • status
  • aside - optional content rendered alongside the header, outside the click target.
  • inner_block (required) - the expanded body.

notifications(assigns)

Stacked toaster for in-app notifications.

Renders the LiveView's @streams.notifications stream as a fixed-position stack in the bottom-right corner. Notifications are pushed via Omni.UI.notify/2,3 and dismissed either manually (X button) or automatically after their timeout.

Attributes

  • stream (:any) (required) - the @streams.notifications assign.

panel(assigns)

Flex column layout with a header and scrollable body.

When the :header slot is provided it replaces the default panel_header/1. Used by AgentLive, SessionsComponent, and FilesComponent as the top-level section wrapper.

Attributes

  • title (:string) - Defaults to "".
  • body_class (:string) - Defaults to nil.

Slots

  • header

panel_header(assigns)

Three-column header bar with a title and optional left/right action slots.

The :align attr controls title placement — "center" (default) uses a three-column grid so the title stays centered regardless of slot widths; "left" or "right" collapses to a two-column flow.

Attributes

  • title (:string) (required)
  • align (:string) - Defaults to "center". Must be one of "left", "center", or "right".

Slots

  • left
  • right

select(assigns)

Dropdown select with support for grouped options.

Attributes

  • id (:string) (required)
  • options (:list) (required)
  • value (:string) - Defaults to nil.
  • prompt (:string) - Defaults to "Select...".
  • name (:string) - Defaults to nil.
  • event (:string) (required)
  • target (:any) - Defaults to nil.
  • position (:string) - Defaults to "below". Must be one of "above", or "below".

timestamp(assigns)

Formatted time display with tooltip showing full date.

Attributes

  • time (DateTime) (required)
  • format (:string) - Defaults to "%Y-%m-%d %H:%M".

usage_block(assigns)

Compact display of token counts and cost.

Attributes

version_nav(assigns)

Prev/next navigation with position indicator (e.g. "2/3").

Attributes

  • version_id (:integer) (required)
  • versions (:list) (required)