Has there been any thought/ideas around Compose We...
# compose-web
j
Has there been any thought/ideas around Compose Web components <> canvas-based components interop?
👍 2
👍🏻 2
s
I did play with it a few months ago, when canvas version just came out. Simple cases can be achieved with ease by positioning html on top with custom layout and transform css. Nesting one in another works with a separate composition and a canvas element. It won't work in all cases, e.g drawing behind bounds can be tricky + requires setting up separate canvas compose root for each nested element But it works!
I also saw a very smart way people achieved html nested in 3d (drei/Html), which works with the same canvas They are positioning html on top and then clipping html element with mask css to display children on top of html element, kinda similar to SurfaceView in a way But not sure it is required here, tbh
j
Interesting! Yep I experimented with that but had concerns around A11y and performance/scalability. But works for now 🙂
s
Yeah, accessibility going to suffer for sure, but that's the canvas problem in general
d
Naive question for someone more familiar with browser technology: Are browser accessibility features really so hard-coupled to the HTML DOM? Is there no API pathway for Canvas components to interact with Accessibility features, even if it would take a little extra work to interface? I keep hearing about accessibility as being an insurmountable problem, but is it really?
s
It is not unsurmountable, but way more manual Html has accessibility built in, meanwhile most canvas based frameworks just push accessibility as a lower priority feature
Tbh, I am not aware how canvas can define accessibility for groups of elements I saw it faked out a few times with empty aria blocks referencing canvas drawings, but not sure canvas can provide it by itself
d
Thanks @shikasd; perhaps there's longer-term hope for a framework solution here given that accessibility is supported on Android through Compose.