w/src/lib/components/form/Field.svelte
2025-01-10 01:28:06 +05:00

25 lines
434 B
Svelte

<script>
/**
* @typedef {Object} Props
* @property {string} [name]
* @property {boolean} [is_vertical]
* @property {import('svelte').Snippet} [children]
*/
/** @type {Props} */
let {
name = $bindable(""),
is_vertical = false,
children
} = $props();
</script>
<div
class="w-auto my-1
{is_vertical ? 'flex-col items-start' : 'items-center'}
flex justify-start"
>
<h1>{name}</h1>
{@render children?.()}
</div>