As we've pointed out in several py-shiny/py-shinywidget issues (e.g., https://github.com/posit-dev/py-shiny/issues/303), rendering "ad hoc (i.e., non-ipywidget) widgets" like folium or itables is possible, but it isn't easy since to do because you need ui.HTML(x._repr_html_()) to get the relevant HTML.
This PR makes it so objects that implement a _repr_html_ method are renderable when they appear as a child of a Tag/TagList. Also note that, using this approach, we can statically and dynamically render these objects:
As we've pointed out in several py-shiny/py-shinywidget issues (e.g., https://github.com/posit-dev/py-shiny/issues/303), rendering "ad hoc (i.e., non-ipywidget) widgets" like folium or itables is possible, but it isn't easy since to do because you need
ui.HTML(x._repr_html_())
to get the relevant HTML.This PR makes it so objects that implement a
_repr_html_
method are renderable when they appear as a child of aTag
/TagList
. Also note that, using this approach, we can statically and dynamically render these objects: