Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
<script lang="ts" module>
import type { FormPath as _FormPath } from 'sveltekit-superforms';
</script>
<script lang="ts" generics="T extends Record<string, unknown>, U extends _FormPath<T>">
import type { WithoutChildren, WithElementRef } from 'bits-ui';
import * as FormPrimitive from 'formsnap';
import type { HTMLAttributes } from 'svelte/elements';
import { cn } from '#lib/utils.js';
let {
ref = $bindable(null),
class: className,
form,
name,
children: childrenProp,
...restProps
}: FormPrimitive.FieldProps<T, U> & WithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> = $props();
</script>
<!-- fallow-ignore-next-line code-duplication -- vendored shadcn-svelte; keep in sync with form-element-field upstream -->
<FormPrimitive.Field {form} {name}>
{#snippet children({ constraints, errors, tainted, value })}
<div bind:this={ref} class={cn('space-y-2', className)} {...restProps}>
{@render childrenProp?.({ constraints, errors, tainted, value: value as T[U] })}
</div>
{/snippet}
</FormPrimitive.Field>