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
Faces.svelte
<script>
// importing other components
import Faces from './Faces.svelte'
let count = 0
const incrementCount = () => {
count++
}
</script>

<style>
h3, button {
font-family: Verdana, Arial, sans-serif;
}
</style>

<h3>
Button was clicked {count} {count === 1 ? 'time' : 'times'}
</h3>

<button on:click|preventDefault={incrementCount}>
Increment count
</button>

<h3>
Imported component:
</h3>
<Faces/>
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */