Skip to content

Fieldset

Group related form controls under a shared label.

Demos

Project details

Set the name used across your workspace.

Usage

vue
<script setup lang="ts">
import { Accordion } from '~/components/ui/accordion'

const items = [
  { value: 'source', label: 'Do I own the source?', content: 'Yes. Copy and adapt the files.' },
]
</script>

<template>
  <Accordion :items="items" />
</template>

Grouped controls

Wrap related fields in a Fieldset. The legend names the group, while descriptions explain what the fields have in common. Disabling the fieldset disables its nested controls.

Disable the fieldset
Project settings

These fields share a disabled state.

vue
<AppLayout :viewport="false" scroll="page">
  <template #header>Workspace</template>
  <template #left><ProjectNavigation /></template>
  <ProjectList />
  <template #footer>2 projects</template>
</AppLayout>

Installation

Complete the shared installation. Copy Fieldset.vue and index.ts into app/components/ui/fieldset/.

API

Props

PropTypeDefaultDescription
legendstringโ€”Fieldset legend.
descriptionstringโ€”Help text linked with aria-describedby.
disabledbooleanfalseDisables grouped controls via native fieldset behavior.
invalidbooleanfalseSets invalid state attributes.
uiFieldsetUiโ€”Classes for root, legend, description, content.

Slots

SlotDescription
defaultGrouped controls.
legendCustom legend content.
descriptionCustom description content.