Skip to content

Commit

Permalink
docs: Update in and out docs to show the imports (#14050)
Browse files Browse the repository at this point in the history
* Update in and out docs to show the imports

* Apply suggestions from code review

---------

Co-authored-by: Rich Harris <[email protected]>
  • Loading branch information
snide and Rich-Harris authored Oct 30, 2024
1 parent dc3c82c commit ee2f4a2
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit ee2f4a2

Please sign in to comment.