Streamlit component that lets you have achievements in your application
Project description
🏆 Streamlit Achievements
A modern, customizable achievement notification component for Streamlit applications. Add beautiful animated achievement unlocks to your apps with customizable styling and behavior.
✨ Features
- Beautiful Animations: Smooth achievement animations
- Floating Mode: Display achievements as floating overlays above content
- Customizable Styling: Full control over colors, shadows, and appearance
- Flexible Positioning: Top, middle, bottom, or custom pixel positioning
- Timing Controls: Configure display duration and fade effects
- Easy Integration: One-line integration with your Streamlit apps
- Icon Support: Use emojis, text, or custom icons in achievements
📦 Installation
pip install streamlit-achievements
🚀 Quick Start
import streamlit as st
from streamlit_achievements import streamlit_achievements
streamlit_achievements(
title="Level Complete!",
description="You finished Level 1",
points=100,
icon_text="🎯"
)
streamlit_achievements(
title="Master Player",
description="Reached 1000 Points",
points=1000,
icon_text="👑",
floating=True,
position="middle",
background_color="#FFD700",
icon_background_color="#FFA500"
)
📋 API Reference
streamlit_achievements()
| Parameter | Type | Description | Default |
|---|---|---|---|
title |
str |
The main title displayed on the achievement | "" |
description |
str |
The achievement description/name | "" |
points |
int |
Point value for the achievement | 0 |
icon_text |
str |
Text or emoji displayed in the circular icon | "" |
duration |
int |
Duration in milliseconds for the animation | 5000 |
icon_background_color |
str |
Color for the circular icon background | "#8BC34A" |
background_color |
str |
Color for the expanding background | "#2E7D32" |
text_color |
str |
Color for text and icon content | "#FFFFFF" |
shadow_color |
str |
Color for shadows and depth effects | "rgba(0,0,0,0.3)" |
auto_width |
bool |
Whether to auto-fit width to container | True |
floating |
bool |
Whether to display as floating overlay above content | False |
position |
str |
Vertical position when floating: 'top', 'middle', 'bottom', or pixel value like '100px' | "top" |
dissolve |
int |
Time in milliseconds to start dissolving/fading effect, 0 = no dissolve | 0 |
🎨 Styling Examples
Classic Achievement
streamlit_achievements(
title="Achievement Unlocked!",
description="First Steps",
points=10,
icon_text="🏆",
icon_background_color="#8BC34A",
background_color="#2E7D32",
text_color="#FFFFFF"
)
Floating Achievement with Custom Position
streamlit_achievements(
title="Floating Success!",
description="You mastered floating mode!",
points=75,
icon_text="🚀",
floating=True,
position="100px", # Custom position from top
duration=6000,
dissolve=3000, # Start fading after 3 seconds
background_color="#9C27B0",
icon_background_color="#E1BEE7"
)
🚀 Example App
A comprehensive example demonstrating all features, styling options, and positioning modes is provided in example.py. Run it with:
streamlit run example.py
🛠️ Development
Local Development
# Clone the repository
git clone https://github.com/lejuliennn/streamlit-achievements.git
cd streamlit-achievements
# Install dependencies
pip install -r requirements.txt
# Run the example
streamlit run example.py
Building
# Build the package
cd ../../..
python setup.py sdist bdist_wheel
# Install locally
pip install -e .
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
📞 Support
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
Project details
Release history Release notifications | RSS feed
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_achievements-0.1.0.tar.gz.
File metadata
- Download URL: streamlit_achievements-0.1.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1163da17c0018942fbc6072e78772f2ebcb48dc9b62d9c9c1b1c3fcc2872839
|
|
| MD5 |
f3323c261ec3c58581e041b554be753b
|
|
| BLAKE2b-256 |
cce9ad068f6d8d7fa7fb5add4e27b1d72058f692b1f25089e79dfab05f32a952
|
File details
Details for the file streamlit_achievements-0.1.0-py3-none-any.whl.
File metadata
- Download URL: streamlit_achievements-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fedde521372559616d2edb2567a75dd98381c29a23f3799211de4c5dca0e37d0
|
|
| MD5 |
f62d955fdfc28dfc2823f0cbcce437ca
|
|
| BLAKE2b-256 |
ae803ec1a85c8ed34b1d25f98a058cdf568f39b845bd75b648aa22124d34de43
|