DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerContainer QueryDividerFlexFloatGridGroupLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTA ModalDate PickerDialogFieldFieldsetFile UploaderIconButtonInputLoading StatesMarqueeMenuNotificationsNumber InputPaginationPin InputPopoverProgress IndicatorsPrompt ModalRadioRatingSelectSliderSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFormat Relative TimeFrameHighlightJSON Tree ViewLocalePortalPresenceShowSwapsplitPropsTheme

Fieldset

The Fieldset component groups form fields together with a shared legend and helper/error text.

  • npm
  • source
  • recipe
  • Ark
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page

Import

import { Fieldset, FieldsetParts } from '@cerberus/react'

Usage

Form Section Example

The Fieldset component can be used to group related form elements together using the usage prop which can be either formSection or fieldGroup (default).

Loading example...

Field Group Example

When use need to label a group of Radio or Checkbox inputs, use the usage prop with the value fieldGroup.

Loading example...

Customizing

You can use style props or the Primitives to customize the Fieldset.

Loading example...

Primitives

You can utilize the primitive components or the css prop to customize the Fieldset.

ComponentDescription
FieldsetRootThe context provider for the Fieldset parts
FieldsetLegendThe label of the fieldset
FieldsetHelperTextThe label description for the Fieldset
FieldsetErrorTextThe error message for the Fieldset

API

Props

The Fieldset component is an abstraction of the primitives and accepts the following props:

NameDefaultDescription
usagefieldGroupThe type of fieldset to display.

The Fieldset component also accepts all the props of the FieldsetRoot primitive props

Parts

The FieldsetParts API is an Object containing the full family of components.

Note

It is best to only use the FieldsetParts if you are building a custom solution. Importing Object based components will ship every property it includes into your bundle, regardless if you use it or not.

NameDescription
RootThe FieldsetRoot component which is the Provider for the family.
LegendThe FieldsetLegend component which displays the label.
HelperTextThe FieldsetHelperText component which displays the description text.
ErrorTextThe FieldsetErrorText component which displays the error text when the group is marked invalid.

On this page

  • Import
  • Usage
    • Form Section Example
    • Field Group Example
  • Customizing
  • Primitives
  • API
    • Props
    • Parts
Edit this page on Github
Update your profileYou can update your profile information here.
This is an error message for the fieldset group.
Who is your favorite?
Custom LegendThis is some custom Helper Text
This is a custom Error Text