How to Create a new plug n play widget

Interessting → would also like to know → how such an plug&play-widget do look like. Any examples existing?