File size: 545 Bytes
ff9325e
246efdb
 
 
 
 
0b5ceff
246efdb
0b5ceff
ff9325e
 
 
 
246efdb
 
 
 
 
 
ff9325e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script lang="ts">
  import type { FieldProps } from "$lib/types";
  import { onMount } from "svelte";
  let { value = $bindable(), params }: { value: boolean; params: FieldProps } =
    $props();

  onMount(() => {
    value = params?.default ? true : false;
  });
</script>

<div class="grid max-w-md grid-cols-4 items-center justify-items-start gap-3">
  <label class="text-sm font-medium" for={params.id}>{params?.title}</label>
  <input
    bind:checked={value}
    type="checkbox"
    id={params.id}
    class="cursor-pointer"
  />
</div>