API Reference — scitex-ui 0.1.0 documentation

# API Reference

scitex-ui — Shared frontend UI components for the SciTeX ecosystem.

Components ship as TypeScript + CSS static assets, discoverable by Django’s AppDirectoriesFinder when added to INSTALLED_APPS.

Python API provides component metadata and registration.

scitex_ui.get_component(name)

  Get metadata for a registered component.

  Return type:

    `Optional`[`Any`]

scitex_ui.list_components()

  List all registered component names.

  Return type:

    `list`[`str`]

scitex_ui.get_static_dir()

  Return the absolute path to scitex_ui’s static asset directory.

  This is the directory containing `css/` and `ts/` subdirectories. Works for both pip-installed packages and editable (dev) installs.

  Useful for build tools (Vite, Webpack) that need to resolve scitex-ui source files at build time.

  Returns:

    e.g. `/usr/lib/python3.11/.../scitex_ui/static/scitex_ui`

  Return type:

    pathlib.Path

## Registry

Component metadata registry.

scitex_ui._registry.register_component(name, metadata)

  Register a frontend component’s metadata.

  Return type:

    `None`

scitex_ui._registry.get_component(name)

  Get metadata for a registered component.

  Return type:

    `Optional`[`Any`]

scitex_ui._registry.list_components()

  List all registered component names.

  Return type:

    `list`[`str`]

## Components

ThemeProvider component metadata.

class scitex_ui._components._theme_provider.ThemeProvider

  Bases: `object`

  Light/dark theme manager with semantic color tokens.

  Manages the data-theme attribute on <html>, persists preference to localStorage, and provides toggle/set/get API.

  TypeScript entry: scitex_ui/ts/shell/theme-provider/index.ts CSS: scitex_ui/css/shell/theme.css

  name = 'theme-provider'
  version = '0.1.0'
  description = 'Light/dark theme manager with semantic color tokens'
  ts_entry = 'scitex_ui/ts/shell/theme-provider/index'
  css_file = 'scitex_ui/css/shell/theme.css'

AppShell component metadata.

class scitex_ui._components._app_shell.AppShell

  Bases: `object`

  Workspace layout shell with collapsible sidebar.

  Creates the three-zone layout: sidebar, main content area, and status bar slot. Supports app-specific accent colors.

  TypeScript entry: scitex_ui/ts/shell/app-shell/index.ts CSS: scitex_ui/css/shell/app-shell.css

  name = 'app-shell'
  version = '0.1.0'
  description = 'Workspace layout shell with collapsible sidebar'
  ts_entry = 'scitex_ui/ts/shell/app-shell/index'
  css_file = 'scitex_ui/css/shell/app-shell.css'

StatusBar component metadata.

class scitex_ui._components._status_bar.StatusBar

  Bases: `object`

  Bottom status bar with left/center/right sections.

  Displays status items with optional icons and click handlers. Designed for workspace-level information display.

  TypeScript entry: scitex_ui/ts/shell/status-bar/index.ts CSS: scitex_ui/css/shell/status-bar.css

  name = 'status-bar'
  version = '0.1.0'
  description = 'Bottom status bar with left/center/right sections'
  ts_entry = 'scitex_ui/ts/shell/status-bar/index'
  css_file = 'scitex_ui/css/shell/status-bar.css'

FileBrowser component metadata.

class scitex_ui._components._file_browser.FileBrowser

  Bases: `object`

  Tree view for navigating file hierarchies.

  Renders a collapsible file tree with directory expand/collapse, file selection, and file-type icons.

  TypeScript entry: scitex_ui/ts/app/file-browser/index.ts CSS: scitex_ui/css/app/file-browser.css

  name = 'file-browser'
  version = '0.1.0'
  description = 'Tree view for navigating file hierarchies'
  ts_entry = 'scitex_ui/ts/app/file-browser/index'
  css_file = 'scitex_ui/css/app/file-browser.css'

class scitex_ui._components._package_docs_sidebar.PackageDocsSidebar

  Bases: `object`

  Navigable sidebar showing SciTeX Python package documentation.

  Fetches package data from a JSON API and renders a grouped, clickable sidebar. Reusable by any SciTeX app.

  TypeScript entry: scitex_ui/ts/app/package-docs-sidebar/index.ts CSS: scitex_ui/css/app/package-docs-sidebar.css API: /apps/docs/api/packages/

  name = 'package-docs-sidebar'
  version = '0.1.0'
  description = 'Navigable sidebar for Python package documentation'
  api_endpoint = '/apps/docs/api/packages/'
  ts_entry = 'scitex_ui/ts/app/package-docs-sidebar/index'
  css_file = 'scitex_ui/css/app/package-docs-sidebar.css'