Skip to main content

🚀 Streamlit Social Share

PyPI version Python 3.8+ Streamlit

A modern, customizable social sharing component for Streamlit applications. Enable users to share your content across multiple social platforms with beautiful, responsive buttons.

Demo

✨ Features

  • Multiple Built-in Networks: X (Twitter), LinkedIn, Facebook, WhatsApp, Telegram and more
  • Custom Networks: Create your own sharing buttons with custom styling and URLs
  • Return Values: Get feedback on which platform users shared to
  • Easy Integration: One-line integration with your Streamlit apps
  • Flexible Icons: Support for emojis, characters, or custom image URLs

🎯 Supported Platforms

📱 Social Media

  • X (Twitter) - Share tweets with text and URLs
  • Threads - Meta's new social platform
  • LinkedIn - Professional network sharing
  • Facebook - Share to Facebook timeline
  • Reddit - Community discussions

💬 Messaging

  • Telegram - Share to Telegram chats
  • WhatsApp - Share via WhatsApp messages
  • Email - Opens default email client

📦 Installation

pip install streamlit-social-share

🚀 Quick Start

import streamlit as st
from streamlit_social_share import streamlit_social_share, create_custom_network

st.title("My Awesome App")

# Basic usage
network = streamlit_social_share(
    text="Check out this amazing Streamlit app!",
    url="https://your-app-url.com",
    networks=["x", "linkedin", "whatsapp", "email"]
)

📋 API Reference

streamlit_social_share()

Parameter Type Description
text str Text to include in the shared message
url str | None URL to share (uses current page if None)
image str | None Image URL to attach (when supported)
networks list[str] | None List of networks to display
key str | None Unique component key

Returns: str | None - The network name if shared, None otherwise

🎨 Custom Networks

Create your own sharing buttons with the create_custom_network() function:

from streamlit_social_share import streamlit_social_share, create_custom_network

# Create custom networks
my_platform = create_custom_network(
    network_id="my_platform",
    name="My Platform", 
    color="#FF6B6B",
    icon="🚀",  # Emoji, character, or image URL
    share_url="https://myplatform.com/share?url={url}&text={text}"
)

dev_to = create_custom_network(
    network_id="dev_to",
    name="Dev.to",
    color="#0A0A0A", 
    icon="https://dev.to/favicon.ico",  # Custom icon URL
    share_url="https://dev.to/new?prefill={text} {url}"
)

# Use custom networks alongside built-in ones
network = streamlit_social_share(
    text="Check out my article!",
    url="https://example.com",
    networks=[my_platform, dev_to, "x", "linkedin"]  # Clean and simple!
)

create_custom_network() Parameters

Parameter Type Description
network_id str Unique identifier for the network
name str Display name for the button
color str Background color (hex code like #FF6B6B)
icon str Emoji (🚀), character, or image URL
share_url str URL template with {text}, {url}, {image} placeholders

Returns: str - The network_id that can be used in the networks parameter

🚀 Example App

A comprehensive example demonstrating all features, network categories, and custom network creation 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-social-share.git
cd streamlit-social-share

# Install dependencies
pip install -r requirements.txt

# Run the example
streamlit run example.py

Building

# Build the package
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

Metadata

Release files for streamlit-social-share 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-social-share 0.1.0
File Size Uploaded Provenance Actions
streamlit_social_share-0.1.0.tar.gz 9.9 kB Without provenance Details for streamlit_social_share-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-social-share 0.1.0
File Interpreter ABI Platform Actions
streamlit_social_share-0.1.0-py3-none-any.whl Python 3 none any Details for streamlit_social_share-0.1.0-py3-none-any.whl

Total release size: 19.4 kB

Release files / streamlit_social_share-0.1.0.tar.gz

Download URL streamlit_social_share-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b8d8064ad2010a82140df5d0d8c0e23f1a3a1ff73776f22f80bfb023dbbd9b90
BLAKE2b-256 checksum
How to use checksums
4f0e46e9492e57082afde0a27688fb83a4eb00f48da7a0a81592942a11ef8fa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / streamlit_social_share-0.1.0-py3-none-any.whl

Download URL streamlit_social_share-0.1.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3daebfb4cea33fb5782dfaf534239be34d58ff99d799f5702df0b95a7ffdfebc
BLAKE2b-256 checksum
How to use checksums
263b9e4abaa49a0c183d33d07d381808e6077711be730610f82c64b19c26647f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for streamlit-social-share 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page