Debian Codegraph @

www/src/content/reference/02-headers/15-HX-Reswap.md

raw symbols SCIP
1 ---
2 title: "HX-Reswap"
3 description: "Override the swap style from the server"
4 ---
5
6 The `HX-Reswap` response header overrides the swap style used when inserting the response, replacing whatever `hx-swap` was set on the triggering element.
7
8 ## Syntax
9
10 ```http
11 HX-Reswap: outerHTML
12 ```
13
14 Accepts the same values as [`hx-swap`](/reference/attributes/hx-swap), including modifiers.
15
16 ## Example
17
18 Force an outer replacement regardless of what the element specified:
19
20 ```python
21 return Response(
22 content,
23 headers={'HX-Reswap': 'outerHTML'}
24 )
25 ```
26
27 With modifiers:
28
29 ```http
30 HX-Reswap: innerHTML transition:true
31 ```
32
33 ## Notes
34
35 - Overrides `hx-swap` on the source element
36 - Evaluated after the response is received, before swapping
37
38 See also: [`hx-swap`](/reference/attributes/hx-swap), [`HX-Retarget`](/reference/headers/HX-Retarget)