File tree Expand file tree Collapse file tree
packages/react/src/components/FormGroup Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,40 @@ import PropTypes from 'prop-types';
99import React from 'react' ;
1010import cx from 'classnames' ;
1111import { usePrefix } from '../../internal/usePrefix' ;
12+ import { ReactAttr } from '../../types/common' ;
13+
14+ export interface FormGroupProps extends ReactAttr < HTMLFieldSetElement > {
15+ /**
16+ * Provide the children form elements to be rendered inside of the <fieldset>
17+ */
18+ children : React . ReactNode ;
19+ /**
20+ * Provide a custom className to be applied to the containing <fieldset> node
21+ */
22+ className ?: string ;
23+ /**
24+ * Specify whether the <FormGroup> is invalid
25+ */
26+ invalid ?: boolean ;
27+ /**
28+ * Provide id for the fieldset <legend> which corresponds to the fieldset
29+ * `aria-labelledby`
30+ */
31+ legendId ?: string ;
32+ /**
33+ * Provide the text to be rendered inside of the fieldset <legend>
34+ */
35+ legendText : React . ReactNode ;
36+
37+ /**
38+ * Specify whether the message should be displayed in the <FormGroup>
39+ */
40+ message ?: boolean ;
41+ /**
42+ * Provide the text for the message in the <FormGroup>
43+ */
44+ messageText ?: string ;
45+ }
1246
1347const FormGroup = ( {
1448 legendId,
@@ -19,7 +53,7 @@ const FormGroup = ({
1953 message,
2054 messageText,
2155 ...rest
22- } ) => {
56+ } : FormGroupProps ) => {
2357 const prefix = usePrefix ( ) ;
2458
2559 const classNamesFieldset = cx ( `${ prefix } --fieldset` , className ) ;
You can’t perform that action at this time.
0 commit comments