Veil UI
Components

Field Group

Groups related fields under a shared legend or heading.

Installation

$ npx veil-ui@latest add field-group

Usage

import {
  FieldGroup,
  FieldGroupLegend,
  FieldGroupRow,
} from "@/components/ui/field-group";

<FieldGroup>
  <FieldGroupLegend>Billing address</FieldGroupLegend>
  <FieldGroupRow>{fields}</FieldGroupRow>
</FieldGroup>;

Examples

Basic

Workspace

Rows

Billing address

Disabled

Managed by your admin

disabled on a <fieldset> disables every nested control at once.

API reference

FieldGroup

PropTypeDefaultDescription
...propsReact.ComponentProps<"fieldset">—All native fieldset attributes. Group-level disabled and form props apply to descendants.

FieldGroupRow

PropTypeDefaultDescription
...propsReact.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>

On this page