Skip to Content
Documentation
Getting startedComponentsChartsTheming
Get Pro
Overview
Concepts

Fieldset

A set of form controls optionally grouped under a common name.

Recipe
Contact detailsPlease provide your contact details below.

Anatomy

import { Fieldset } from '@chakra-ui/react'
<Fieldset.Root>
  <Fieldset.Legend />
  <Fieldset.HelperText />
  <Fieldset.Content />
  <Fieldset.ErrorText />
</Fieldset.Root>

Examples

Basic

Group related fields under a common Fieldset.Legend. Use the size prop on the Fieldset.Root to change the spacing and typography of the group.

Contact detailsPlease provide your contact details below.

Disabled

Use the disabled prop to disable the fieldset to disable all input elements within the fieldset.

Shipping details

Invalid

Use the invalid prop to mark the fieldset as invalid. This will show the error text.

Note: You need to pass the invalid prop to the Field component within the fieldset to make each input element invalid.

Shipping details
Some fields are invalid. Please check them.

Props

PropDefaultType
colorPalette 'gray'
'base' | 'gray' | 'zinc' | 'neutral' | 'stone' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'sidebar' | 'sidebar.accent' | 'interaction' | 'accent' | 'presence' | 'status' | 'slate'

The color palette of the component

size 'md'
'sm' | 'md' | 'lg'

The size of the component

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
invalid
boolean

Indicates whether the fieldset is invalid.