anywidget icon indicating copy to clipboard operation
anywidget copied to clipboard

Anywidget layout library for composing anywidgets

Open faysou opened this issue 7 months ago • 4 comments

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.

Image Image

Importance

nice to have

faysou avatar May 12 '25 08:05 faysou

I experimented with some related ideas in https://github.com/keller-mark/with-html/blob/main/demo.ipynb

keller-mark avatar Oct 29 '25 16:10 keller-mark

Looks nice ! Thank you

faysou avatar Oct 29 '25 17:10 faysou

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).

manzt avatar Nov 10 '25 21:11 manzt

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.

faysou avatar Nov 10 '25 22:11 faysou