Skip to main content

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>
Enter and exit with show
editable
Browser preview
rReady to explore
Environment & events

Browser rendering of the shared document. Host services are bundled demo mocks. XML edits reset local state; data edits preserve compatible state.

Interact with the preview to inspect emitted events and mocked service calls.

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>
Compare show and if
editable
Browser preview
rReady to explore
Environment & events

Browser rendering of the shared document. Host services are bundled demo mocks. XML edits reset local state; data edits preserve compatible state.

Interact with the preview to inspect emitted events and mocked service calls.

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.