Skip to content

Embed

Overview

Embed allows you to embed/iframe another web site in your Mesop app.

Examples

import mesop as me


@me.page(
  security_policy=me.SecurityPolicy(
    allowed_iframe_parents=["https://google.github.io"]
  ),
  path="/embed",
)
def app():
  src = "https://google.github.io/mesop/"
  me.text("Embedding: " + src)
  me.embed(
    src=src,
    style=me.Style(width="100%", height="100%"),
  )

API

embed

This function creates an embed component.

PARAMETER DESCRIPTION
src

The source URL for the embed content.

TYPE: str

style

The style to apply to the embed, such as width and height.

TYPE: Style | None DEFAULT: None

key

The component key.

TYPE: str | None DEFAULT: None