Streamlit Swipecards allow you to add interactive swipeable cards to your app.
Project description
UNDER DEVELOPMENT! - NOT FULLY TESTED!
💕 Streamlit Swipe Cards
A Tinder-like swipe cards component for Streamlit! Create beautiful, interactive card interfaces with smooth swipe animations.
Features
- 🎴 Stacked card interface - Cards stack behind each other like Tinder
- 👆 Touch & mouse support - Swipe with finger or mouse
- 🎯 Three actions - Like (right), Pass (left), and Back
- 🎨 Beautiful animations - Smooth swipe animations with visual feedback
- 📱 Mobile responsive - Works great on all devices
- 🖼️ Image support - Upload files or use URLs
- ⚡ Easy to use - Simple Python API
Installation instructions
pip install streamlit-swipecards
Usage instructions
import streamlit as st
from streamlit_swipecards import streamlit_swipecards
# Define your cards
cards = [
{
"name": "Alice Johnson",
"description": "Software Engineer who loves hiking and photography",
"image": "https://example.com/alice.jpg"
},
{
"name": "Bob Smith",
"description": "Chef and foodie exploring the world",
"image": "https://example.com/bob.jpg"
}
]
# Create the swipe interface
result = streamlit_swipecards(cards=cards, key="swipe_cards")
# Handle the result
if result:
st.write(f"You {result['action']} {result['card']['name']}!")
Card Data Format
Each card should be a dictionary with these required fields:
{
"name": str, # Person's name (required)
"description": str, # Description text (required)
"image": str # Image URL or base64 data (required)
}
Quick Start Examples
Run the basic example:
streamlit run example.py
Run the full demo with card creation:
streamlit run demo.py
Actions
The component returns a dictionary when a user takes an action:
{
"card": {...}, # The card data that was acted upon
"action": "right", # Action taken: "right", "left", or "back"
"cardIndex": 0 # Index of the card in the original list
}
How to Use
- Swipe right 💚 or click the like button to like a card
- Swipe left ❌ or click the pass button to pass on a card
- Click back ↶ to undo your last action
- Cards stack behind each other for a realistic experience
- Smooth animations provide visual feedback
Made with ❤️ for the Streamlit community
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_swipecards-0.1.2.tar.gz.
File metadata
- Download URL: streamlit_swipecards-0.1.2.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44b8a2fcd469c20bfd4fa3ee3e0d88b76dfa8e811fa7645eecd449165244070f
|
|
| MD5 |
6b054cf759b68e1e2dbb07b52f58597a
|
|
| BLAKE2b-256 |
1f5421579ed5c50b8d3c85c1bfcff2c532cda64d60a2dfbd480cc96014f6237d
|
File details
Details for the file streamlit_swipecards-0.1.2-py3-none-any.whl.
File metadata
- Download URL: streamlit_swipecards-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
567e812c1b5633f287583de74f9dffa07c024a701e67db79bcd6aee5ed8dffd1
|
|
| MD5 |
fd155f2eeca5b1a70aabefe115aaeff5
|
|
| BLAKE2b-256 |
b8e49407ffaa329064173ab4427f69e5c653e5d59d340115844723e7f617b7d5
|