Spec-Zone.ru › htmx

HX-Reswap

Overrides swap style from server

The HX-Reswap response header overrides the swap style used when inserting the response, replacing whatever hx-swap was set on the triggering element.

Syntax

HX-Reswap: outerHTML

Accepts the same values as hx-swap, including modifiers.

Force an outer replacement regardless of what the element specified:

return Response(
    content,
    headers={'HX-Reswap': 'outerHTML'}
)

With modifiers:

HX-Reswap: innerHTML transition:true

Notes

  • Overrides hx-swap on the source element
  • Evaluated after the response is received, before swapping

See also: hx-swap, HX-Retarget

Licensed under the Zero-Clause BSD License.
https://four.htmx.org/reference/headers/HX-Reswap/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API