Skip to main content

DashA2UI

A2UI Protocol Implementation for Dash - Declarative UI generation for LLM agents.

Overview

DashA2UI implements the A2UI (Agent-to-User Interface) Protocol v0.8 for generating declarative, streaming UI payloads that can be rendered by A2UI-compatible clients.

A2UI is designed to be:

  • LLM-friendly: Flat adjacency list model, easy for LLMs to generate incrementally
  • Secure: Declarative data format, not executable code
  • Framework-agnostic: Same payload renders on web, Flutter, etc.

Installation

# Core package (no framework dependencies)
pip install "dasha2ui @ git+https://github.com/Cemberk/dasha2ui.git"

# With Dash renderer support
pip install "dasha2ui[dash] @ git+https://github.com/Cemberk/dasha2ui.git"

# Everything
pip install "dasha2ui[all] @ git+https://github.com/Cemberk/dasha2ui.git"

From Local Clone

git clone https://github.com/Cemberk/dasha2ui.git
cd dasha2ui
pip install -e .[dash]  # Editable install with Dash support

From PyPI (when published)

pip install dasha2ui[dash]
pip install dasha2ui[all]

Quick Start

Building A2UI Surfaces

from dasha2ui import (
    A2UISurface, text, row, column, card,
    TextUsageHint, Distribution
)

# Create a surface
surface = A2UISurface("my-dashboard")

# Add components
title = surface.add(text("Dashboard", usage_hint=TextUsageHint.H1))
subtitle = surface.add(text("Welcome!", usage_hint=TextUsageHint.BODY))

# Create layout
content = surface.add(column([title.id, subtitle.id]))

# Build A2UI messages
messages = surface.build(root_id=content.id)

# Output as JSON
print(surface.to_json_array(root_id=content.id))

Using Pre-built Templates

from dasha2ui import build_dashboard_ui

messages = build_dashboard_ui(
    title="Sales Dashboard",
    metrics=[
        {"title": "Total Sales", "value_path": "/sales/total", "icon": "shoppingCart"},
        {"title": "Orders", "value_path": "/sales/orders", "icon": "payment"},
    ],
    data={"sales": {"total": "$12,345", "orders": "156"}}
)

Rendering in Dash

from dasha2ui.renderers.dash_renderer import A2UIRenderer

# Process A2UI messages
renderer = A2UIRenderer()
renderer.process_messages(messages)

# Get Dash component
dash_component = renderer.render()

# Use in your Dash app
app.layout = html.Div([dash_component])

Components

DashA2UI supports all A2UI v0.8 standard components:

Layout

  • row() - Horizontal flex layout
  • column() - Vertical flex layout
  • list_component() - Scrollable list
  • card() - Card container

Content

  • text() - Text with typography hints (h1-h5, body, caption)
  • image() - Image with sizing hints
  • icon() - Material Design icons
  • divider() - Horizontal/vertical divider

Interactive

  • button() - Button with action
  • text_field() - Text input
  • checkbox() - Checkbox
  • slider() - Slider
  • multiple_choice() - Selection
  • tabs() - Tab navigation
  • modal() - Modal dialog

Media

  • video() - Video player
  • audio_player() - Audio player

Data Binding

Components can bind to a data model using paths:

from dasha2ui import text, BoundString, A2UISurface

surface = A2UISurface("example")

# Bind text to data model path
value = surface.add(text(BoundString.bound("/metrics/total")))

# Set data
surface.set_data({"metrics": {"total": "1,234"}})

Streaming

For progressive UI generation:

from dasha2ui import A2UIStream, text, column

stream = A2UIStream("dashboard")

# Send initial structure
yield stream.begin_rendering("root")

# Stream components
title = text("Loading...", id="title")
yield stream.surface_update([title])

# Update data progressively
yield stream.data_update({"status": "Ready"})

LLM Integration

A2UI is designed for LLM output. Example prompt:

Generate A2UI JSON to display a dashboard with:
- Title: "Performance Metrics"
- 3 metric cards showing CPU, Memory, Disk usage

Output format: JSON array of A2UI messages

License

MIT License

Metadata

Release files for dasha2ui 0.1.0

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

Source distribution (sdist)

Source distribution for dasha2ui 0.1.0
File Size Uploaded Provenance Actions
dasha2ui-0.1.0.tar.gz 19.3 kB Without provenance Details for dasha2ui-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dasha2ui 0.1.0
File Interpreter ABI Platform Actions
dasha2ui-0.1.0-py3-none-any.whl Python 3 none any Details for dasha2ui-0.1.0-py3-none-any.whl

Total release size: 37.8 kB

Release files / dasha2ui-0.1.0.tar.gz

Download URL dasha2ui-0.1.0.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ec976afe419c965746c793e0b54ac51350b2eeb20f32cf48bbaab6cc1594af06
BLAKE2b-256 checksum
How to use checksums
ae441cfb7767644ffd3172dcde358f4c07b1295cab936ffd6acd4a778d4741a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / dasha2ui-0.1.0-py3-none-any.whl

Download URL dasha2ui-0.1.0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5659003d37455d81cff0ac9a1da4751e2c5fdee52a699511eebd6e9ac4a463b1
BLAKE2b-256 checksum
How to use checksums
01e61c2e748b9bb20548f871030cd4587ce81253a12ff9e424b28ef501ecff98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for dasha2ui 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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