Skip to main content

Fieldset: React

A Fieldset is used to provide contextual information around a group of form controls in a web form.

Installation

Before you can start using the @mediahuis/chameleon-react component, you’ll need to install it, for more information check: Getting started for developers.

With that done, you’re now ready to implement the component in your application.

import { Fieldset } from '@mediahuis/chameleon-react';

export default function Example() {
return (
<Fieldset label="Fieldset Label">
<input />
<button>Click</button>
</Fieldset>
);
}

Properties

PropertyTypeDefaultRequiredDescription
actionReactNode-NoThe contents displayed within the ActionLabel.
childrenReactNode-YesThe contents displayed within the Fieldset.
classNameString-NoAllows extending the class names of the Fieldset component.
disabledBoolean-NoSpecifies whether a group of related form elements should be disabled.
errorBoolean-NoIndicates whether the Fieldset is visually displayed as error text. It will add the necessary accessibility tags.
hiddenBoolean-NoDetermines whether the label of the Fieldset should be visually hidden.
htmlForString-NoReferences a specific input using the HTML For attribute.
idString-NoSets the native HTML id attribute.
labelReactNode-NoSets the Fieldset's legend.
messageString-NoThe contents displayed beneath the legend.
nameString-NoSpecifies a name for the fieldset.
optionalLabelString-NoThe contents displayed within the fieldset.