Anywidget layout library for composing anywidgets
Describe the problem
I just had the idea that an anywidget layout library could be useful to assemble subcomponent anywidgets into bigger components.
Describe the proposed solution
I just asked this to gemini and it provided a prototype for it, where the layout is JavaScript that instantiates anywidgets.
I think it could be useful to have a purely python based solution to compose anywidgets, with the JavaScript hidden.
Of course anywidgets can still be assembled in each environments like jupyter notebook, and streamlit, or JavaScript directly, but I think that having the ability to compose components outside environments could be useful as well.
Importance
nice to have
I experimented with some related ideas in https://github.com/keller-mark/with-html/blob/main/demo.ipynb
Looks nice ! Thank you
This request has come up a few times previously. I think it's within scope and something we'd like to support in the long term (an API for composing anywidgets within anywidgets).
The biggest challenge is that it will likely require more APIs from existing host platforms to support. We'd probably want to scope for a larger update. Probably less technical challenge than social (agreeing on APIs, getting "hosts" to buy in and implement).
Basically something that's needed is that a composition like the one of @keller-mark is still a widget, and a constructor allows to pass arguments to sub components.