Components
Field Group
Groups related fields under a shared legend or heading.
Installation
$ npx veil-ui@latest add field-groupUsage
import {
FieldGroup,
FieldGroupLegend,
FieldGroupRow,
} from "@/components/ui/field-group";
<FieldGroup>
<FieldGroupLegend>Billing address</FieldGroupLegend>
<FieldGroupRow>{fields}</FieldGroupRow>
</FieldGroup>;Examples
Basic
Rows
Disabled
disabled on a <fieldset> disables every nested control at once.
API reference
FieldGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | React.ComponentProps<"fieldset"> | — | All native fieldset attributes. Group-level disabled and form props apply to descendants. |
FieldGroupRow
| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | React.ComponentProps<"div"> | — | Two-column grid from the sm breakpoint up. |
Accessibility
- The
<legend>names the whole fieldset, so screen readers announce the group when entering any field inside it. - The fieldset resets the browser's default border and padding; spacing comes from the grid.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add field-group --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { cn } from "@/lib/utils";
const props = defineProps<{ class?: string }>();
</script>
<template>
<fieldset
data-slot="field-group"
:class="cn('grid min-w-0 gap-4 border-0 p-0', props.class)"
>
<slot />
</fieldset>
</template>