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
<img src="/icon.svg" alt="hide/show" slot="icon" />
<span slot="error" let:error>
{formatError(error)}
</span>
</Field>

Text

Number

Checkbox

Email

Password

Tel

Url

Textarea