flbxcup/resources/js/components/ui/form/form-label.svelte
2025-06-23 23:12:40 +02:00

24 lines
584 B
Svelte

<script lang="ts">
import * as FormPrimitive from "formsnap";
import { Label } from "@/components/ui/label/index.js";
import { cn, type WithoutChild } from "@/lib/utils.js";
let {
ref = $bindable(null),
children,
class: className,
...restProps
}: WithoutChild<FormPrimitive.LabelProps> = $props();
</script>
<FormPrimitive.Label {...restProps} bind:ref>
{#snippet child({ props })}
<Label
{...props}
data-slot="form-label"
class={cn("data-[fs-error]:text-destructive", className)}
>
{@render children?.()}
</Label>
{/snippet}
</FormPrimitive.Label>