Skip to content

Recipes

Each recipe documents the short form, the expanded HTML, the optional macro, and the server response contract. Recipes tagged needs a behavior require an installX() from @hypermedia-components/core; the rest are pure htmx attributes.

  • Mutating form — post a form with inline 4xx errors, a success redirect, and a double-submit guard. (needs installFieldErrors)
  • Confirm action — guard a destructive request behind a confirmation dialog. (needs installConfirm)
  • Request action — a button that fires an htmx request with a busy state.
  • Inline edit — swap a value between display and edit modes in place.
  • Live search — debounced search-as-you-type that swaps results.
  • Filter popover — a popover hosting a filter form that closes on success. (needs installClosePopover)
  • Lazy panel — defer loading a panel until it is revealed.
  • Data region — a self-refreshing region driven by HX-Trigger.
  • Datagrid pagination — server-driven pager with out-of-band row swaps. (needs installDatagrid)
  • Chart — upgrade a server-sent data table into an Observable Plot SVG chart. (needs installChart + Plot)
  • Remote dialog — load a dialog’s contents from the server on open. (needs installRemoteDialog + installCloseDialog)
  • Toast — fire toast notifications from the client or an HX-Trigger header. (needs installToast)