Widgets are written and defined in twine script, while other "standard" macros are written in JavaScript. The widget macro automates the process of creating a macro, but limits your ability to use certain features; for example if you want to create a macro that has child tags, like <<if>> and <<else>>, you're usually better off just making a macro in JavaScript.
Generally, I'd say widgets should be used as shortcuts to save time on writing code that you use a lot, while standard macros should be used to extend or add functionality.
Which one you use when both would work is down to preference and confidence working in JavaScript.
Comments
Widgets are written and defined in twine script, while other "standard" macros are written in JavaScript. The widget macro automates the process of creating a macro, but limits your ability to use certain features; for example if you want to create a macro that has child tags, like <<if>> and <<else>>, you're usually better off just making a macro in JavaScript.
Generally, I'd say widgets should be used as shortcuts to save time on writing code that you use a lot, while standard macros should be used to extend or add functionality.
Which one you use when both would work is down to preference and confidence working in JavaScript.