Animate entering and leaving
Define an entering and exiting appearance for one retained message.
Before you start: Conditional content and your first transition.
Base classes describe the visible target. enter: describes where the node arrives from; exit: describes where it leaves to. These phase endpoints do not need an ordinary target-transition selector.
Enter and exit with show
The same show instance can reverse when you reopen it during exit.
<Column state="{open:true}" class="p-4 gap-3">
<Button title="Show or hide" on-press="toggle open" />
<Column show="open" class="enter:opacity-0 exit:opacity-0 spring-soft">
<Text text="A retained message" />
</Column>
</Column>
Try it: Reopen quickly. Then try enter:translate-y-2 alongside the fade.
Compare show and if
Changing show to if also changes logical lifetime. Outgoing presentation is inert where supported; reinsertion creates fresh local state.
<Column state="{open:true}" class="p-4 gap-3">
<Button title="Show or hide" on-press="toggle open" />
<Column show="open" state="{draft:''}">
<TextField label="Retained with show" model="draft" />
</Column>
<Column if="open" state="{draft:''}">
<TextField label="Recreated with if" model="draft" />
</Column>
</Column>
Try it: Type into both fields and compare retained versus recreated drafts.
Logical dismissal and input/accessibility lifetimes do not wait for decorative motion. Next: dialogs and sheets. Reference: phase endpoints.