Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

FieldError.svelte

12 lines292 Bytes

1<script lang="ts">
2 import type { AnyFieldApi } from '@tanstack/svelte-form'
3​
4 const { field }: { field: AnyFieldApi } = $props()
5</script>
6​
7<small
8 role={field.meta.isInvalid ? 'alert' : undefined}
9 aria-live="polite"
11 {field.errors.map((error) => error.message).join('\n')}
12</small>