Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
Input.svelte
Keypad.svelte
Timer.svelte
<script>
import Keypad from './Keypad.svelte';
import Timer from './Timer.svelte';

let countdown;
</script>

<div>
{#if countdown}
<Timer
on:new={() => {
countdown = null;
}}
{countdown}
/>
{:else}
<Keypad
on:countdown={(e) => {
countdown = e.detail;
}}
/>
{/if}
</div>

<style>
:global(*) {
box-sizing: border-box;
margin: 0;
padding: 0;
}

:global(body) {
min-height: 100vh;
color: hsl(0, 0%, 98%);
background: hsl(240, 80%, 6%);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */