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

All template syntax commands · Svelte and SvelteKit 5 cheatsheet

Was this page helpful?