Skip to main content

Streamlit component that lets you have achievements in your application

Project description

🏆 Streamlit Achievements

PyPI version Python 3.8+ Streamlit

A modern, customizable achievement notification component for Streamlit applications. Add beautiful animated achievement unlocks to your apps with customizable styling and behavior.

Demo

✨ 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 6500
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 disappearing; if 0/omitted, it disappears ~3s after the background fully fills 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=6500,
    dissolve=5300,  # Disappear ~3s after background fill completes
    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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📞 Support

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

streamlit_achievements-0.1.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_achievements-0.1.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_achievements-0.1.1.tar.gz.

File metadata

  • Download URL: streamlit_achievements-0.1.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for streamlit_achievements-0.1.1.tar.gz
Algorithm Hash digest
SHA256 84654967e4267f6d95113ce846ca3fb7bef2cd5c8e81e666ee5fd6a93a923dd9
MD5 9412f95e8441b012834d0c20ae3eea9e
BLAKE2b-256 2eb7f94790db89beda8695a8c05869b3f9bcb9cb6d855673649be746423f7754

See more details on using hashes here.

File details

Details for the file streamlit_achievements-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_achievements-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7bd7ddb1400093f23c050ad68f281ed8c62e77f3e25581dbc4ba0a37465848e0
MD5 d78d5e7f1a4c4f32066d94e10948cc8f
BLAKE2b-256 5a43162ce061d303dd3cf05a857360b8252d7d2b23cb143612e4ddcd5b41cc6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page