How langflow-ai/langflow-embedded-chat works
Langflow Embedded Chat is an embeddable web component for chatting with a Langflow flow. A host page supplies configuration; the widget manages open state and messages, the chat window accepts input and displays replies, and its controller sends requests to Langflow. The window renders messages and sending placeholders, while utilities handle response extraction, positioning, and header parsing. Styling and other behavior are configurable through the component API. Source excerpts show the request and rendering path; some widget internals are only partially excerpted, so links are limited to documented imports and visible calls.
Main entry points: chatWindow/index.tsx Chat window · chatWidget/index.tsx Chat widget · index.ts Request controller · utils.ts Widget utilities
Components 11
Embedding
- Custom element
src/index.tsx
Chat interface
- Chat widget
src/chatWidget/index.tsx - Chat trigger
src/chatWidget/chatTrigger/index.tsx - Chat window
src/chatWidget/chatWindow/index.tsx - Message renderer
src/chatWidget/chatWindow/chatMessage/index.tsx - Sending placeholder
src/chatPlaceholder/index.tsx
Request runtime
- Request controller
src/controllers/index.ts - Widget utilities
src/chatWidget/utils.ts - Message types
src/types/chatWidget/index.ts
Other components
- Host application
- Langflow API
Connections 15
- Host application → Custom element: embeds
README.md - Custom element → Chat widget: registers
src/index.tsx - Chat widget → Chat trigger: renders
src/chatWidget/index.tsx - Chat widget → Chat window: renders
src/chatWidget/index.tsx - Chat window → Request controller: sends request
src/chatWidget/chatWindow/index.tsx - Request controller → Langflow API: posts flow input
src/controllers/index.ts - Request controller → Chat window: returns response
src/chatWidget/chatWindow/index.tsx - Chat window → Message renderer: renders messages
src/chatWidget/chatWindow/index.tsx - Chat window → Sending placeholder: renders while sending
src/chatWidget/chatWindow/index.tsx - Chat window → Widget utilities: uses helpers
src/chatWidget/chatWindow/index.tsx - Request controller → Widget utilities: parses headers
src/controllers/index.ts - Chat widget → Widget utilities: parses headers
src/chatWidget/index.tsx - Chat window → Message types: uses message types
src/chatWidget/chatWindow/index.tsx - Message renderer → Message types: uses message types
src/chatWidget/chatWindow/chatMessage/index.tsx - Sending placeholder → Message types: uses placeholder type
src/chatPlaceholder/index.tsx