File: simple.md | Updated: 11/15/2025
Search...
+ K
Auto
Docs Examples GitHub Contributors
Docs Examples GitHub Contributors
Docs Examples GitHub Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide
Documentation
Framework
Svelte
Version
Latest
Search...
+ K
Menu
Getting Started
API Reference
Examples
Framework
Svelte
Version
Latest
Menu
Getting Started
API Reference
Examples
Svelte Example: Simple
=======================================================================================================================================================================================================================================================================================================================================================================================================
Code ExplorerCode
Interactive SandboxSandbox
src
App.svelte
Display.svelte
Increment.svelte
main.ts
store.ts
vite-env.d.ts
.gitignore
README.md
index.html
package.json
svelte.config.js
tsconfig.json
tsconfig.node.json
vite.config.ts
svelte
<script lang="ts">
import Increment from './Increment.svelte'
import Display from './Display.svelte'
</script>
<h1>How many of your friends like cats or dogs?</h1>
<p>
Press one of the buttons to add a counter of how many of your friends like
cats or dogs
</p>
<Increment animal="dogs" />
<Display animal="dogs" />
<Increment animal="cats" />
<Display animal="cats" />
<script lang="ts">
import Increment from './Increment.svelte'
import Display from './Display.svelte'
</script>
<h1>How many of your friends like cats or dogs?</h1>
<p>
Press one of the buttons to add a counter of how many of your friends like
cats or dogs
</p>
<Increment animal="dogs" />
<Display animal="dogs" />
<Increment animal="cats" />
<Display animal="cats" />
