Source... <script type="module"> funce("a-button", ['color'], aButton); function aButton({ clicks, color, init, props }) { const style = clicks ? `border-color:${color}; color:${color}` : ''; const label = !clicks ? "please click" : `thank you ${clicks > 1 && `* ${clicks}` || ''}`; init?.props({ clicks: 0, }); function clicked() { return props({clicks: ++clicks}); } return html`<button @click = ${clicked} style = ${style}>${label}</button>`; } </script> <a-button color="red"></a-button>