feat: add errors to textfield

This commit is contained in:
EETagent 2022-11-25 16:23:49 +01:00
parent f61dfa6a8e
commit 8813e67237

View file

@ -7,14 +7,17 @@
export let value: string = ''; export let value: string = '';
export let icon: boolean = false; export let icon: boolean = false;
export let error: string = "";
</script> </script>
<div class="mt-8 relative flex justify-center items-center"> <div class="relative flex justify-center items-center">
<input <input
class:error={error}
bind:value bind:value
on:click on:click
on:keydown on:keydown
on:keyup on:keyup
on:change
class:withIcon={icon} class:withIcon={icon}
class="bg-[#f8fafb] w-full shadow-lg p-3 rounded-lg text-xl outline-none border transition-colors duration-300 hover:border-sspsBlue border-2" class="bg-[#f8fafb] w-full shadow-lg p-3 rounded-lg text-xl outline-none border transition-colors duration-300 hover:border-sspsBlue border-2"
use:typeAction use:typeAction
@ -28,7 +31,13 @@
</div> </div>
<style> <style>
div, input {
@apply w-full;
}
.withIcon { .withIcon {
@apply pr-14; @apply pr-14;
} }
.error {
@apply border-red-700;
}
</style> </style>