htmx 4.0 is under construction — migration guide

htmx:process:{type}

Custom template processing

The htmx:process:type event is an internal event fired when a <template> tag has a custom type attribute that needs processing.

When It Fires

When htmx encounters a <template> element with a custom type attribute during processing.

Event Detail

  • ctx - Processing context
  • tasks - Array of processing tasks

Example

<template type="custom-widget"> <!-- Custom template content --> </template>
htmx.on('htmx:process:custom-widget', (evt) => { console.log('Processing custom template'); // Handle custom template type });

This allows extensions to define custom template processing logic.