htmx

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2025 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Overview

templ: version: v0.2.747

Index

Constants

View Source
const (
	// Request header for the user response to an hx-prompt.
	HeaderPrompt = "HX-Prompt"

	// Request header that is always “true” for HTMX requests.
	HeaderRequest = "Hx-Request"
)

HTTP request headers

View Source
const StatusStopPolling int = 286

286 Stop Polling

HTTP status code that tells HTMX to stop polling from a server response.

For more info, see https://htmx.org/docs/#load_polling

View Source
const URL = "/.within.website/x/htmx/"

URL is the folder path where the HTMX static files are served from.

Variables

View Source
var (
	//go:embed *.js
	Static embed.FS
)

Functions

func Is

func Is(r *http.Request) bool

Is returns true if the given request was made by HTMX.

func Mount

func Mount(mux *http.ServeMux)

Mount the HTMX static directory to a given path on a ServeMux.

If you use the Core or Use functions, you will need to ensure that HTMX is mounted at the correct path. Otherwise it will not be able to find the required JavaScript files.

func Use

func Use(exts ...string) templ.Component

Use pulls in the HTMX core library and any extensions.

Right now the extensions you can choose from are:

  • event-header
  • path-params
  • remove-me
  • websocket

This is mostly based on the extensions that I personally use.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL