• Docs
  • Blog
    • 0.24.0

    • Switch to dark mode
    Get Started
    Components
    Styling
    Theming

    Concepts

    OverviewCompositionTesting

    Layout

    Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrap

    Components

    AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

    Utilities

    Feature FlagsForLocal StoragePortalShowsplitPropsTheme

    Fieldset

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

    • npm
    • source
    • recipe
    • Ark
    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).

    Update your profileYou can update your profile information here.
    This is an error message for the fieldset group.

    Field Group Example

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

    Who is your favorite?

    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
    Custom LegendThis is some custom Helper Text
    This is a custom Error Text

    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

    • Edit this page on Github
    Cerberus Design System | Docs