You could try using arcgis-js-cli utility:
It has a parameter to scaffold an experience builder widget:
'arcgis widget my-widget -t exb'
And from there build you button and logic behind !
Hope that help