Swaps a fragment with an animated transition.
You can use a predefined transition or define your own.
Note
Transitions are not possible when replacing the
<body>element. To transition the entire page, wrap it in a container element.
The link will load the fragment #story from the URL /page2.
Once the response is received, the old fragment version will fly out to the left, while the new
version will fly in from the right.
<a href="/page2"
up-target="#story"
up-transition="move-left">
Next page
</a>
The form will load the fragment .content from the URL /tasks.
Once the response is received, the old fragment version will fade out, while the new
version will fade in.
<form action="/tasks"
up-target=".content"
up-transition="cross-fade">
...
</form>
Info
All modifying attributes for
[up-follow](links) or[up-submit](forms) may also be used.
The name of a transition.
The duration of the transition in milliseconds.
The timing function that controls the acceleration of the transition.
The transition to use when the server responds with an error code.
Tip Your coding agent can search these docs locally with the Unpoly agent skill