scrimba
Learn Svelte
Event handling
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Event handling
AboutCommentsNotes
Event handling
Expand for more info
App.svelte
run
preview
console
<script>
import Face from './Face.svelte';
import Container from './Container.svelte';
import Header from './Header.svelte';
let showHeader = false;
setTimeout(() => {
showHeader = true;
}, 1000);
</script>


{#if showHeader}
<Header />
{/if}
<Container>

</Container>

<style>
div {
color: red;
}
:global(*) {
box-sizing: border-box;
}
:global(body, html) {
margin: 0;
height: 100vh;
overflow: hidden;
}
</style>
Console
/index.html
-2:29