FormGroup
is a form component that groups a label with a form element (e.g. Switch
or TextInput
).
import { FormGroup, TextInput } from '@wordpress/components/ui';
function Example() {
return (
<FormGroup label="First name">
<TextInput />
</FormGroup>
);
}
Type: CSS['alignItems']
Adjusts the block alignment of children.
Type: Pick<TextProps, "align">
Aligns the label within FormGroup
.
Type: string
Adjusts the horizontal and vertical alignment of children.
Type: number
,(number
,null)[]
Adjusts the number of columns of the Grid
.
Type: number
Gap between each child.
Type: React.ReactElement
Displays help content.
Type: boolean
Displays the label and form field horizontally.
Type: boolean
Changes the CSS display from grid
to inline-grid
.
Type: CSS['justifyContent']
Adjusts the inline alignment of children.
Type: string
Label of the form field.
labelHidden
Type: boolean
Visually hides the label.
Type: number
,(number
,null)[]
Adjusts the number of rows of the Grid
.
Type: CSS['gridTemplateColumns']
Adjusts the CSS grid template-columns
.
Type: CSS['gridTemplateRows']
Adjusts the CSS grid template-rows
.
Type: boolean
Truncates the label text content.