Skip to main content

Render an HTML iframe within a Streamlit app

Project description

Streamlit IFrame Component

This component is an iframe wrapper that allows you to render an HTML iframe component and receive data posted using window.parent.postMessage in the src URL.

Features

  • Render an HTML iframe within a Streamlit app.
  • Capture and return data posted from the iframe using window.parent.postMessage.

Usage

Install streamlit-iframe with pip

pip install streamlit-iframe

Use the component in your Streamlit app:

import streamlit as st
from streamlit_iframe import streamlit_iframe

event = streamlit_iframe({
    "src": "https://www.example.com",
    "height": "500px",
    "width": "600px",
})

Development

To set up the development environment, follow these steps:

  1. Create a virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
    
  2. Install the required dependencies:

    pip install streamlit
    

Running the Example

To run the example Streamlit app, use the following command:

streamlit run ./example.py

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_iframe-0.1.0.tar.gz (379.6 kB view details)

Uploaded Source

Built Distribution

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

streamlit_iframe-0.1.0-py3-none-any.whl (382.6 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_iframe-0.1.0.tar.gz.

File metadata

  • Download URL: streamlit_iframe-0.1.0.tar.gz
  • Upload date:
  • Size: 379.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for streamlit_iframe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a761f78cfe05c7dab89027e5c344682dd5fda6e3f38571f97eddbf6eedebaab
MD5 d490b5920deabeddec1fe7b7bde63c5a
BLAKE2b-256 17cbae8fa0eca97add74ff05d089e06aaa52083e25de86f63259d058d8e6c210

See more details on using hashes here.

File details

Details for the file streamlit_iframe-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_iframe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 581f5669168a9707e4913e4bfd5ce73cbbd0cab2c690817baadd8fec63f48589
MD5 020d534190c075ce3d0fe437f9aeb6b6
BLAKE2b-256 a7ec22b2da90ec0b857e03c295d91aafc26e78fe9e064405ee046ba8b8ac69eb

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