The html_of_jsx.ppx preprocessor transforms JSX syntax into efficient HTML rendering code, validating attributes and their types at compile time.
Pass flags after html_of_jsx.ppx in your dune (preprocess ...) stanza.
-htmxEnables htmx attributes (hx_get, hx_post, hx_swap, ...) and extension-specific attributes (sse_connect, ws_send, ...) on all HTML elements.
(preprocess (pps html_of_jsx.ppx -htmx))Requires the html_of_jsx.htmx library for the <Htmx /> script loader. See HTMX mode.
-reactEnables React DOM aliases: className maps to class and htmlFor maps to for. Useful as a migration bridge from React/Reason-React codebases.
(preprocess (pps html_of_jsx.ppx -react))See React compatibility.
-disable-static-optDisables compile-time static analysis and optimization. Every element falls back to the generic JSX.node constructor. Useful for debugging the ppx output.
(preprocess (pps html_of_jsx.ppx -disable-static-opt))For details on what the static optimization does, see How the ppx works.