Lustre HTMX

Package Version Hex Docs

Lustre HTMX is a Gleam package that provides HTMX integration for the Lustre web framework. It allows you to easily add HTMX attributes to your Lustre HTML elements, enabling dynamic, AJAX-powered web applications with minimal JavaScript.

Installation

Add lustre_htmx to your Gleam project:

gleam add lustre_hx

Usage

import lustre_hx as hx
import lustre/element.{button, div, text}

pub fn main() {
  div([], [
    // Example: Create a button that loads content via HTMX GET request
    button([hx.get("/example")], [
      text("Get some HTML")
    ])
  ])
}

Features

Documentation

For detailed documentation and examples, visit hexdocs.pm/lustre_htmx.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell
Search Document