@setoelkahfi / svara / commits / 8680990

feat: added input component

mellbacon committed Jun 14, 2023 at 17:09 UTC 8680990541bd207eb65bf5263d97b545c90b7e3e
1 file changed +28
src/lib/utility/Input.svelte new
+28
@@ -0,0 +1,28 @@
1 +<script lang="ts">
2 + export let readonly = false;
3 + export let label = null;
4 + export let placeholder = "";
5 +
6 + export let value = "";
7 +</script>
8 +
9 +{#if label}
10 + <label for="textInput">{label}:</label>
11 +{/if}
12 +
13 +<input bind:value type="text" name="textInput" id="textInput" readonly={readonly} placeholder={placeholder}>
14 +
15 +<style lang="scss">
16 + label {
17 + font-size: 0.9rem;
18 + color: #c6c6c6;
19 + }
20 + input {
21 + border: none;
22 + background-color: #333;
23 + border-bottom: 1px solid #6f6f6f;
24 + padding: 0.6em 0.4em 0.6em 0.8em;
25 + color: white;
26 + width: 100%;
27 + }
28 +</style>
\ No newline at end of file