Skip to main content

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

  1. Swipe right 💚 or click the like button to like a card
  2. Swipe left ❌ or click the pass button to pass on a card
  3. Click back ↶ to undo your last action
  4. Cards stack behind each other for a realistic experience
  5. Smooth animations provide visual feedback

Made with ❤️ for the Streamlit community

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_swipecards-0.1.2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

streamlit_swipecards-0.1.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

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

Hashes for streamlit_swipecards-0.1.2.tar.gz
Algorithm Hash digest
SHA256 44b8a2fcd469c20bfd4fa3ee3e0d88b76dfa8e811fa7645eecd449165244070f
MD5 6b054cf759b68e1e2dbb07b52f58597a
BLAKE2b-256 1f5421579ed5c50b8d3c85c1bfcff2c532cda64d60a2dfbd480cc96014f6237d

See more details on using hashes here.

File details

Details for the file streamlit_swipecards-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_swipecards-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 567e812c1b5633f287583de74f9dffa07c024a701e67db79bcd6aee5ed8dffd1
MD5 fd155f2eeca5b1a70aabefe115aaeff5
BLAKE2b-256 b8e49407ffaa329064173ab4427f69e5c653e5d59d340115844723e7f617b7d5

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