Saltearse al contenido

Field

Esta página aún no está disponible en tu idioma.

You can use the Field component to render a form field. This component is for simple text, number, email, etc. fields. If you need to render a select, checkbox, radio, etc. you can use the Select, Option, File , etc. components.

The Field component by default renders a text field. You can change the type of the field using the type prop.

<script lang="ts">
import { Field } from "@tuentyfaiv/svelte-form";
</script>
<Field name="name" label="Name:" />
<!-- Or -->
<Field name="name" label="Name:">
This is a custom label
<svelte:fragment let:show slot="icon">
<i class="icon">{show ? "👀" : "🙈"}</i>
</svelte:fragment>
<svelte:fragment slot="error" let:error>
{formatError(error)}
</svelte:fragment>
</Field>

Text

Number

Checkbox

Email

Password

Tel

Url

Textarea