Svelte Forms Lib

This is a fully interactive Svelte form component using Svelte's reactivity system for validation.

{#if showSuccess}
Success! Form submitted successfully! The secret is: dumbledore
{/if}

User Information

{#if errors.firstName}
{errors.firstName}
{/if}
{#if errors.lastName}
{errors.lastName}
{/if}
{#if errors.email}
{errors.email}
{/if}
{#if errors.phone}
{errors.phone}
{/if}
{#if errors.website}
{errors.website}
{/if}

Profile

{#if errors.username}
{errors.username}
{/if}
{#if errors.password}
{errors.password}
{/if}
{#if errors.confirmPassword}
{errors.confirmPassword}
{/if}

Preferences

Additional Fields

Not Satisfied Very Satisfied
{#if errors.termsAgreement}
{errors.termsAgreement}
{/if}
{#if showModal} {/if} `; // Create and mount the Svelte component new Svelte.Component({ target: document.getElementById('svelte-form-root'), props: {}, hydrate: false });