Use HTMX
Add HTMX interactivity with the @primate/htmx module.
npm i @primate/htmximport config from "primate/config";
import htmx from "@primate/htmx";
export default config({
modules: [
htmx(),
],
});<!-- components/Welcome.htmx -->
<h1>Hello, World!</h1>
<button hx-get="/api/greet" hx-target="#greeting">Greet</button>
<div id="greeting"></div>// routes/index.ts
import route from "primate/route";
import response from "primate/response";
export default route({
get() {
return response.view("Welcome.htmx");
},
});