Skip to main content

iframe

Project description


tags: [gradio-custom-component, SimpleTextbox] title: gradio_iframecomponent short_description: iframe colorFrom: blue colorTo: yellow sdk: gradio pinned: false app_file: space.py

gradio_iframecomponent

Static Badge

iframe

Installation

pip install gradio_iframecomponent

Usage

import gradio as gr
from gradio_iframecomponent import IFrame

def create_demo():
    with gr.Blocks() as demo:
        gr.Markdown("# IFrame Component Demo")
        
        iframe = IFrame(
            label="Web Page Viewer",
            value="https://www.gradio.app",
            interactive=True,
            height=500
        )
        
        url_input = gr.Textbox(
            label="Enter URL",
            placeholder="https://example.com"
        )
        
        load_btn = gr.Button("Load URL")
        
        load_btn.click(
            fn=lambda url: url,
            inputs=url_input,
            outputs=iframe
        )
    
    return demo

if __name__ == "__main__":
    demo = create_demo()
    demo.launch()

IFrame

Initialization

name type default description
value
str
"" None
src
str | None
None None
width
str | int
"100%" None
height
str | int
400 None
sandbox
str | None
None None
interactive
bool
True None
visible
bool
True None
elem_id
str | None
None None
elem_classes
list[str] | str | None
None None
render
bool
True None
label
str | None
None None
show_label
bool
True None

Events

name description
change Triggered when the value of the IFrame changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See .input() for a listener that is only triggered by user input.
input This listener is triggered when the user changes the value of the IFrame.

User function

The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).

  • When used as an Input, the component only impacts the input signature of the user function.
  • When used as an output, the component only impacts the return signature of the user function.

The code snippet below is accurate in cases where the component is used as both an input and an output.

def predict(
    value: str | None
) -> str | None:
    return value

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

gradio_iframecomponent-0.0.1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

gradio_iframecomponent-0.0.1-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file gradio_iframecomponent-0.0.1.tar.gz.

File metadata

  • Download URL: gradio_iframecomponent-0.0.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for gradio_iframecomponent-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8fcec3c09e33334011fdf65a28040be494107b7ee8648e556600d95511c391d0
MD5 1301b0d24aa03c5b75626995b07cb193
BLAKE2b-256 da583d7b275450136ed1e1b56027fe80e16553eeb4808a9e63464a0f39c34049

See more details on using hashes here.

File details

Details for the file gradio_iframecomponent-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gradio_iframecomponent-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a91625b53703cb783351a02986a9d581967237b64512c4d078dd592a40e99995
MD5 94a07ee930b6a47dc1642d018a222ca6
BLAKE2b-256 cd912504890532d5c117bed2bbb2a145a0ca8b295c0f47ea586196e25a09ed9e

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