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
Property | Type | Default | Required | Description |
---|---|---|---|---|
action | ReactNode | - | No | The contents displayed within the ActionLabel. |
children | ReactNode | - | Yes | The contents displayed within the Fieldset. |
className | String | - | No | Allows extending the class names of the Fieldset component. |
disabled | Boolean | - | No | Specifies whether a group of related form elements should be disabled. |
error | Boolean | - | No | Indicates whether the Fieldset is visually displayed as error text. It will add the necessary accessibility tags. |
hidden | Boolean | - | No | Determines whether the label of the Fieldset should be visually hidden. |
htmlFor | String | - | No | References a specific input using the HTML For attribute. |
id | String | - | No | Sets the native HTML id attribute. |
label | ReactNode | - | No | Sets the Fieldset's legend. |
message | String | - | No | The contents displayed beneath the legend. |
name | String | - | No | Specifies a name for the fieldset. |
optionalLabel | String | - | No | The contents displayed within the fieldset. |