Viewof for custom component

Could we get an example of the viewof operator working on a custom component?

My motivation is to have a slider with its value displayed inline. Something like:

viewof foo = customSliderWithValueShowing()
1 Like

Good question! We’ve been making one-off custom components with viewof for a while but never really written it up. So I did: Exploring viewof - should help!

Mike also has a great example of a simple linked input.

1 Like

Very cool! So, Mike’s example didn’t need to emit a CustomEvent because the input events from the children bubble up to the div anyway. Thanks for clearing that up with the canvas example!