feat(ui): add id prop for inputs
Some checks failed
Deploy to GitHub Pages / build_site (push) Failing after 5s

This commit is contained in:
Felix Hungenberg
2026-01-19 16:43:41 +01:00
parent ecfd4d5f2f
commit 0cfd1e5c96
4 changed files with 184 additions and 8 deletions

View File

@@ -1,9 +1,10 @@
<script lang="ts">
interface Props {
value: boolean;
id?: string;
}
let { value = $bindable(false) }: Props = $props();
let { value = $bindable(false), id }: Props = $props();
$effect(() => {
if (typeof value === 'string') {
@@ -23,6 +24,7 @@
type="checkbox"
bind:checked={value}
class="peer absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]"
{id}
/>
<span
class="absolute opacity-0 peer-checked:opacity-100 transition-opacity duration-100 flex w-full h-full items-center justify-center"