Skip to content

docs: Update in and out docs to show the imports #14050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions documentation/docs/03-template-syntax/14-in-and-out.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ title: in: and out:
The `in:` and `out:` directives are identical to [`transition:`](transition), except that the resulting transitions are not bidirectional — an `in` transition will continue to 'play' alongside the `out` transition, rather than reversing, if the block is outroed while the transition is in progress. If an out transition is aborted, transitions will restart from scratch.

```svelte
<script>
import { fade, fly } from 'svelte/transition';

let visible = $state(false);
</script>

<label>
<input type="checkbox" bind:checked={visible}>
visible
</label>

{#if visible}
<div in:fly out:fade>flies in, fades out</div>
{/if}
Expand Down