In Formsnap, a Control is used to wrap any interactive form element (like an <input>, <select>, or custom checkbox) to ensure it is correctly associated with a Label for accessibility.
Because the Control component does not render an HTML element itself, it uses a children snippet to provide necessary attributes (like id, aria-describedby, etc.) to the actual input element. This separation allows Field components to be used for multi-control inputs like radio groups or checkbox groups without being tied to a single specific element.
To use it, wrap your input inside the Control component and use the children snippet to access and spread the provided props onto your element.
<Control>
{#snippet children({ props })}
<input type="text" {...props} bind:value={$formData.name} />
{/snippet}
</Control>