Lib: Add text input
This commit is contained in:
29
src/lib/components/Input.svelte
Normal file
29
src/lib/components/Input.svelte
Normal file
@ -0,0 +1,29 @@
|
||||
<script lang="ts">
|
||||
let {
|
||||
id,
|
||||
name,
|
||||
label,
|
||||
placeholder = "",
|
||||
type = "text",
|
||||
value = "",
|
||||
disabled = false,
|
||||
required = false,
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<label
|
||||
for={id}
|
||||
class="input input-bordered mt-2 flex !cursor-default select-none items-center gap-2"
|
||||
>
|
||||
{label}
|
||||
<input
|
||||
{id}
|
||||
{name}
|
||||
{type}
|
||||
class={disabled ? "pointer-events-none grow !cursor-default" : "grow"}
|
||||
{disabled}
|
||||
{required}
|
||||
{placeholder}
|
||||
{value}
|
||||
/>
|
||||
</label>
|
Reference in New Issue
Block a user