Your target selectors may use this pseudo-selector to replace the layer's topmost swappable element.
The topmost swappable element is the first child of the layer's container element:
<body> element.{ target } that the overlay was opened with.Use :layer to replace all visible elements of a layer. To only update a layer's main fragment
while keeping static layout elements around it, see :main.
We open an overlay with a target selector #foo:
up.layer.open({ target: '#foo', content: 'Hello from overlay' })
The topmost swappable element is now #foo, which we can select with :layer:
// targets '#foo'
up.render({ target: ':layer', url: '/page2' })
The resolution of :layer depends on the targeted layer. For example, when rendering in
the root layer, :layer will resolve to the <body>:
// targets the body
up.render({ target: ':layer', layer: 'root', url: '/page2' })
Tip Your coding agent can search these docs locally with the Unpoly agent skill