mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
Button 및 Input 컴포넌트를 atoms 디렉터리로 이동 및 리팩토링
This commit is contained in:
25
src/lib/components/atoms/inputs/CheckBox.svelte
Normal file
25
src/lib/components/atoms/inputs/CheckBox.svelte
Normal file
@@ -0,0 +1,25 @@
|
||||
<script lang="ts">
|
||||
import type { Snippet } from "svelte";
|
||||
|
||||
import IconCheckCircle from "~icons/material-symbols/check-circle";
|
||||
import IconCheckCircleOutline from "~icons/material-symbols/check-circle-outline";
|
||||
|
||||
interface Props {
|
||||
checked?: boolean;
|
||||
children?: Snippet;
|
||||
}
|
||||
|
||||
let { checked = $bindable(false), children }: Props = $props();
|
||||
</script>
|
||||
|
||||
<label class="flex items-center gap-x-1">
|
||||
<input bind:checked type="checkbox" class="hidden" />
|
||||
<div>
|
||||
{@render children?.()}
|
||||
</div>
|
||||
{#if checked}
|
||||
<IconCheckCircle class="text-primary-600" />
|
||||
{:else}
|
||||
<IconCheckCircleOutline class="text-gray-300" />
|
||||
{/if}
|
||||
</label>
|
||||
Reference in New Issue
Block a user