mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-07 00:30:11 +00:00
feat: add errors to textfield
This commit is contained in:
parent
f61dfa6a8e
commit
8813e67237
1 changed files with 10 additions and 1 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue