A floating chat bubble component for Streamlit apps
Project description
Streamlit Bubble Chat
Floating chat bubble UI for Streamlit apps.
Add a persistent chat window with unread badges, system messages, and optional agent avatars.
streamlit-bubble-chat is a drop-in component for adding a floating chat window
to a Streamlit app. It works well for support flows, assistant side panels, and
multi-agent demos where you want the chat UI available without rearranging the
rest of the page.
Installation
uv add streamlit-bubble-chat
Or with pip:
pip install streamlit-bubble-chat
Quick start
import streamlit as st
from streamlit_bubble_chat import bubble_chat
if "messages" not in st.session_state:
st.session_state.messages = [
{"role": "assistant", "content": "Hello. How can I help?"},
]
def handle_message() -> None:
text = st.session_state.support_chat.new_message
if not text:
return
st.session_state.messages.append({"role": "user", "content": text})
st.session_state.messages.append(
{"role": "assistant", "content": f"Echo: {text}"}
)
bubble_chat(
messages=st.session_state.messages,
key="support_chat",
on_message=handle_message,
)
Core arguments
bubble_chat(
messages,
*,
type="simple",
unread_count=0,
window_title="Chat",
theme_color=None,
assistant_config=None,
name_colors=None,
key=None,
on_message=None,
)
Each message is a dictionary with role, content, and an optional name:
{"role": "assistant", "content": "Hello", "name": "Guide"}
Inside on_message, read the submitted text from st.session_state[key].new_message.
The component also stores is_open and is_maximized in the same session-state entry.
What you get
- Floating chat bubble anchored to the bottom-right corner.
simplemode for a clean message list.avatarmode for named assistants with emoji or:material/...:icons.- Unread badges and an unread divider when new messages arrive.
- System messages rendered as centered pills.
- Theme-aware styling plus optional color overrides.
- User and assistant avatar customization.
Examples
| Example | What it shows | Command |
|---|---|---|
examples/base_chat.py |
Simple mode, unread badges, system messages, name colors | uv run streamlit run examples/base_chat.py |
examples/avatar_chat.py |
Avatar mode, multiple assistants, Material icons, custom avatar colors | uv run streamlit run examples/avatar_chat.py |
If you need fresh frontend assets first:
make build-frontend
Development
make setup
make check
make test
make build
make setup installs Python dependencies with uv, frontend dependencies with
npm ci, and the configured git hooks with prek.
Contributing
Contribution guidelines live in CONTRIBUTING.md.
Disclaimer
This project was built primarily with AI assistance. If you spot artifacts, inconsistencies, or things that don't make sense, please open an issue.
License
Released under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit_bubble_chat-0.1.1.tar.gz.
File metadata
- Download URL: streamlit_bubble_chat-0.1.1.tar.gz
- Upload date:
- Size: 22.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9088371bb3740e80a51283689ada0c88ac215ab2c82d5353c47fff6d1698db60
|
|
| MD5 |
925d9db149d293f550ef561f3d290d12
|
|
| BLAKE2b-256 |
1c15936bd2bde52c09d24595713bf2388df97a10c3842804a7f7f4792792e83d
|
Provenance
The following attestation bundles were made for streamlit_bubble_chat-0.1.1.tar.gz:
Publisher:
release.yml on igonro/streamlit-bubble-chat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamlit_bubble_chat-0.1.1.tar.gz -
Subject digest:
9088371bb3740e80a51283689ada0c88ac215ab2c82d5353c47fff6d1698db60 - Sigstore transparency entry: 1281049398
- Sigstore integration time:
-
Permalink:
igonro/streamlit-bubble-chat@68a66d95310cbc3379f789f7fb4a2ce491208683 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/igonro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@68a66d95310cbc3379f789f7fb4a2ce491208683 -
Trigger Event:
push
-
Statement type:
File details
Details for the file streamlit_bubble_chat-0.1.1-py3-none-any.whl.
File metadata
- Download URL: streamlit_bubble_chat-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c13b070c951e704703e5628a57b35b2dec6c80d94594f16fcad659db7f4cbfae
|
|
| MD5 |
dc19f819e2dfc52e4b5ff1d588809c65
|
|
| BLAKE2b-256 |
d4380dc14d6a9a0b343629d95499523e92d93b404b6f39f91888ed404b84dc17
|
Provenance
The following attestation bundles were made for streamlit_bubble_chat-0.1.1-py3-none-any.whl:
Publisher:
release.yml on igonro/streamlit-bubble-chat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamlit_bubble_chat-0.1.1-py3-none-any.whl -
Subject digest:
c13b070c951e704703e5628a57b35b2dec6c80d94594f16fcad659db7f4cbfae - Sigstore transparency entry: 1281049401
- Sigstore integration time:
-
Permalink:
igonro/streamlit-bubble-chat@68a66d95310cbc3379f789f7fb4a2ce491208683 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/igonro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@68a66d95310cbc3379f789f7fb4a2ce491208683 -
Trigger Event:
push
-
Statement type: