Skip to main content
InterviewHubPRO
Section Overview
Q11

Question 11 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

22%
Svelte & SvelteKit (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

Svelte Transitions (`transition:fade`) and Animations (`animate:flip`).

junior LevelCode ExampleSvelte 5

In Simple Words: Svelte features first-class built-in transition directives that execute CSS hardware-accelerated animations when elements enter or leave the DOM:

svelte
<script>
  import { fade, slide } from 'svelte/transition';
  import { flip } from 'svelte/animate';
  let items = $state([1, 2, 3]);
</script>

{#each items as item (item)}
  <div transition:slide animate:flip={{ duration: 300 }}>
    Item {item}
  </div>
{/each}