Svelte and SvelteKit 5 · Template syntax
Bind form inputs
bind:value keeps a variable and an input in sync in both directions.
<input bind:value={name} />
<input type="checkbox" bind:checked={subscribed} />
<select bind:value={size}>...</select>
Official Svelte and SvelteKit 5 documentation
More template syntax commands
- Show content conditionally
- Loop over a list
- Show an async result
- Handle events
- Toggle classes
- Reusable markup with snippets
All template syntax commands · Svelte and SvelteKit 5 cheatsheet