@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-corefunction
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:
falseboolean
Enable file attachments. Default:
falseMessageList
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:
falseboolean
Disable input. Default:
falseMessage 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']