Skip to main content
Version: devel

dlt._workspace.helpers.dashboard.utils.ui

Dashboard UI helpers: tables, callouts, section boilerplate, and shared utilities.

BoundedDict Objects

class BoundedDict(Dict[Any, Any])

View source on GitHub

Dict that evicts the oldest entry when maxsize is exceeded.

dlt_table

def dlt_table(data: Union[List[Dict[str, Any]], pyarrow.Table],
*,
selection: Optional[str] = None,
style: bool = True,
freeze_column: Optional[str] = "name",
initial_selection: Optional[List[int]] = None,
pagination: Optional[bool] = None,
show_download: Optional[bool] = None,
**kwargs: Any) -> mo.ui.table

View source on GitHub

Create a styled mo.ui.table with common dashboard defaults.

Applies alternating-row styling, freezes the given column, aligns dict keys, and sets initial_selection to None when data is empty.

Arguments:

  • data - Table data as a list of dicts or a pyarrow Table.
  • selection - Selection mode ("single", "multi") or None to disable.
  • style - Whether to apply alternating-row cell styling.
  • freeze_column - Column name to freeze on the left. Pass None to disable.
  • initial_selection - Row indices to pre-select. Forced to None when data is empty.
  • pagination - Passed through to mo.ui.table.
  • show_download - Passed through to mo.ui.table.

small

def small(text: str) -> str

View source on GitHub

Wrap text in <small> HTML tags for consistent dashboard styling.

error_callout

def error_callout(message: str,
code: str = None,
traceback_string: str = None) -> mo.Html

View source on GitHub

Build a callout with a message and a exposable stacktrace.

Arguments:

  • message str - The message to display in the callout.
  • code str - The code to display in the callout.
  • traceback_string str - The traceback to display in the callout.

Returns:

  • mo.ui.Callout - The callout with the message and the stacktrace.

title_and_subtitle

def title_and_subtitle(title: str,
subtitle: str = None,
title_level: int = 3) -> mo.Html

View source on GitHub

Build a title and a subtitle block

def page_header(dlt_pipeline: dlt.Pipeline,
section_strings: TSectionStrings,
button: mo.ui.switch = None) -> List[mo.Html]

View source on GitHub

Build a page header with a title, a subtitle, button and conditional longer subtitle.

When collapsed, the short subtitle is shown inline after the title to save vertical space. When expanded, the longer subtitle appears on its own line.

section_marker

def section_marker(section_name: str, has_content: bool = False) -> mo.Html

View source on GitHub

Create an invisible marker element to identify sections for CSS styling.

Arguments:

  • section_name - Name identifier for the section (e.g., "home_section", "schema_section")
  • has_content - If True, adds 'has-content' class to enable CSS styling (borders, backgrounds). Should be True only when the section has actual content and is displayed.

Returns:

Hidden HTML div element with section marker classes for CSS targeting.

section

def section(section_strings: TSectionStrings, dlt_pipeline: dlt.Pipeline,
switch: mo.ui.switch) -> Tuple[List[mo.Html], bool]

View source on GitHub

Build standard section boilerplate: marker + page header.

Returns:

Tuple of (result list, should_render_content). The list already contains the section marker and header. Append content only when should_render_content is True, then call mo.vstack(result).

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.