Hi @haishiro
This is a really, really good and natural question. I’ve been wanting to create my own library of Panel extensions since I started using Panel and also contribute some that I felt where general purpose.
One way to do it is the advanced way creating Bokeh https://docs.bokeh.org/en/latest/docs/user_guide/extensions.html. That is actually how most of the layouts, panes and widgets in Panel are built. BUT THAT IS NOT APPROPRIATE FOR YOUR USE CASE.
You want to combine the existing components of Panel into a new component. And that should be the most frequent used way to create extensions to Panel.
But as far as I know this is not really described anywhere as all the examples focus on showing how to create a small dashboard or app. And I don’t remember seeing any suggestions in the different Channels (Gitter, Github, Discourse).
I think this is fundamental question to answer. I hope the community and the core developers will join the discussion and we can have an answer.
Below I will provide my take.
ps. Your question comes just at the right time as I started working on https://github.com/marcskovmadsen/panel-extensions-template the same day. I also announced it on Discourse here How to create Panel Extensions?. I will use your question and example as inspiration for improvements.
pps. Looking back I actually created a discussion/ feature request for this https://github.com/holoviz/panel/issues/1072 half a year ago.