Skip to main content
The @mariozechner/pi-web-ui package provides React components for building web-based AI chat interfaces.

Import

Core Components

ChatPanel

Complete chat interface with message list, input, and agent integration.
Agent
required
Agent instance from @mariozechner/pi-agent-core
function
required
Callback when user sends a message
'light' | 'dark'
Theme mode. Default: 'light'

AgentInterface

Complete agent interface with sidebar and settings.
Agent
required
Agent instance
function
required
Callback with message text and optional attachments
boolean
Show sidebar with sessions. Default: false
boolean
Enable file attachments. Default: false

MessageList

Scrollable message list with custom renderers.
AgentMessage[]
required
List of messages to display
AgentMessage | null
Currently streaming message

Input

Message input with autocomplete and attachments.
function
required
Callback when message is submitted
string
Input placeholder text
boolean
Enable file attachments. Default: false
boolean
Disable input. Default: false

Message Components

UserMessage

Render a user message.

AssistantMessage

Render an assistant message with markdown.
string | Content[]
required
Message content
string
Reasoning/thinking content to display

ToolMessage

Render a tool execution result.
string
required
Name of the tool
Content[]
required
Tool result content
any
Tool-specific metadata

Dialog Components

ModelSelector

Dialog for selecting models.
boolean
required
Whether dialog is open
function
required
Callback to close dialog
Model
required
Currently selected model
function
required
Callback when model is selected

SettingsDialog

Dialog for application settings.
boolean
required
Whether dialog is open
function
required
Callback to close dialog
string[]
Tabs to show. Default: ['general', 'api-keys']

SessionListDialog

Dialog for browsing and switching sessions.

Utility Components

ThinkingBlock

Collapsible thinking/reasoning display.

ConsoleBlock

Code execution console output.

ExpandableSection

Collapsible section with header.

AttachmentTile

File attachment preview.

Custom Tool Renderers

Register custom renderers for tool results:

Custom Message Renderers

Register custom renderers for message types:

Example: Complete App