Py.Cafe

maartenbreddels/

solara-iframe-with-html-code

Web App: Interactive HTML Preview using Solara

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
import solara

clicks = solara.reactive(0)

html = solara.reactive("<html><body><h1>Hi there</h1>I am in an iframe</body></html>")

@solara.component
def Page():
    solara.InputText(label="html", value=html)
    solara.v.Html(tag="iframe", attributes={"srcdoc": html.value})