Modrinth/src/package/components/FormField.svelte
2022-06-04 00:46:23 -07:00

24 lines
404 B
Svelte

<script lang="ts">
import { uniqueId } from '../utils/uniqueId'
export let required = false
export let label: string
const id = `form-field-${uniqueId()}`
</script>
<div class="form-field">
<label for={id} class="text-input__label" class:required>
{label}
</label>
<slot {id} />
</div>
<style lang="postcss">
.form-field {
display: flex;
flex-direction: column;
gap: 8px;
}
</style>