[READ-ONLY] Mirror of https://github.com/probablykasper/niceform. Convenient form validation and typing for SvelteKit
0

Configure Feed

Select the types of activity you want to include in your feed.

Simplify Input.svelte example

authored by

Kasper and committed by
GitHub
(Feb 1, 2025, 9:17 AM +0100) a706cff9 6ba63bce

+3 -8
+3 -8
README.md
··· 38 38 39 39 ```svelte 40 40 <script lang="ts" generics="F extends PartialNiceForm"> 41 - import type { HTMLInputAttributes } from 'svelte/elements' 42 - import { scale, slide } from 'svelte/transition' 43 - import { backOut } from 'svelte/easing' 44 41 import { sequential_num, type AddFormProps, type PartialNiceForm } from './niceform' 42 + import type { HTMLInputAttributes } from 'svelte/elements' 45 43 46 44 let { 47 45 form, ··· 61 59 {/if} 62 60 <input class={['input', props['class']]} id={label ? id : undefined} bind:value {...props} /> 63 61 {#if props.name && errors[props.name]} 64 - <span class="block origin-top-left" in:scale={{ duration: 250, easing: backOut }}> 65 - <span class="block text-sm text-red-500" transition:slide={{ duration: 100 }}> 66 - {errors[props.name]} 67 - </span> 68 - </span> 62 + <span class="text-red-500">{errors[props.name]}</span> 69 63 {/if} 70 64 </div> 65 + 71 66 ``` 72 67 73 68 ### i18n example