I strongly suggest trying putting your htmx snippets in .re
files, and making use of tyxml’s jsx ppx. This and other similar topics are touched on in this thread: Htmx/htmlact web development approach - #16 by cemerick
Using this approach, I find it quite pleasant and easy to bring HTML+tailwind templates and snippets into jsx/tyxml.