package pure-html

  1. Overview
  2. Docs

Module Pure_html.HxSource

htmx support

The attributes in this module are arranged in the same order as on the reference page linked above.

Remember that you will also need the htmx script itself. The recommended way to get it is to download a copy and place it in your static assets directory, managed by dreamwork so that it is properly cached and version-hashed by its contents.

Core attributes

Sourceval get : _ string_attr
Sourceval post : _ string_attr
Sourceval on_ : event:string -> _ string_attr

The hx-on:* set of attributes, where * represents DOM events: https://htmx.org/attributes/hx-on/.

Note that the value of this attribute is not escaped.

  • since 2.1.0.
Sourceval push_url : _ string_attr
Sourceval select : _ string_attr

Note that the value of this attribute is not escaped as it may include a CSS selector.

Sourceval select_oob : _ string_attr

Note that the value of this attribute is not escaped as it may include a CSS selector.

Sourceval swap : _ string_attr

Note that the value of this attribute is not escaped as it may include a CSS selector.

Sourceval swap_oob : _ string_attr

Note that the value of this attribute is not escaped as it may include a CSS selector.

Sourceval target : _ string_attr

Note that the value of this attribute is not escaped as it may include a CSS selector.

Sourceval trigger : _ string_attr

Note that the value of this attribute is not escaped.

Sourceval vals : _ string_attr

Additional attributes

Sourceval boost : bool to_attr
Sourceval confirm : _ string_attr
Sourceval delete : _ string_attr
Sourceval disable : attr
Sourceval disabled_elt : _ string_attr
  • since 3.6.0.
Sourceval disinherit : _ string_attr
Sourceval encoding_formdata : attr

Hardcoding of the hx-encoding attribute to multipart/form-data.

Sourceval ext : _ string_attr
Sourceval headers : _ string_attr
Sourceval history_false : attr

Hardcoding of the hx-history attribute to false.

Sourceval history_elt : attr
Sourceval include_ : _ string_attr
Sourceval indicator : _ string_attr

Note that the value of this attribute is not escaped as it may include a CSS selector.

Sourceval inherit_ : _ string_attr
  • since 3.6.0.
Sourceval params : _ string_attr
Sourceval patch : _ string_attr
Sourceval preserve : attr
Sourceval prompt : _ string_attr
Sourceval put : _ string_attr
Sourceval replace_url : _ string_attr
Sourceval request : _ string_attr
Sourceval sync : _ string_attr
Sourceval validate : attr

Extensions

Sourceval preload : attr
Sourceval sse_close : _ string_attr
  • since 3.6.0.
Sourceval sse_connect : _ string_attr
Sourceval sse_swap : _ string_attr
Sourceval ws_connect : _ string_attr
Sourceval ws_send : attr

Other

This attribute serves as the _ attribute, which is used by Hyperscript. Note that the value of this attribute is not escaped.

  • since 0.1.0.

Note that the value of this attribute is not escaped.

  • deprecated See https://htmx.org/attributes/hx-on/#hx-on-deprecated
OCaml

Innovation. Community. Security.