Form validation
Validation is achieved by applying isInvalid
and optionally error props onto the EuiForm or EuiFormRow components. Errors are optional and are passed as an array in case you need to list more than one. You can also hide the callout by passinginvalidCallout=“none“
Props
EuiForm
Prop | Description and type | Default value |
---|---|---|
Prop className# | Description and type Type: string | Default value |
Prop aria-label# | Description and type Defines a string value that labels the current element. string | Default value |
Prop data-test-subj# | Description and type Type: string | Default value |
Prop css# | Description and type Type: Interpolation<Theme> | Default value |
Prop component# | Description and type Which HTML element to render "div" | "form" | Default value div |
Prop isInvalid# | Description and type Type: boolean | Default value |
Prop error# | Description and type Type: ReactNode | ReactNode[] | Default value |
Prop invalidCallout# | Description and type Where to display the callout with the list of errors "none" | "above" | Default value above |
Prop fullWidth# | Description and type When set to boolean | Default value false |
Prop ref# | Description and type Allows getting a ref to the component instance. LegacyRef<HTMLElement> | Default value |
EuiFormRow
Prop | Description and type | Default value |
---|---|---|
Prop labelType# | Description and type Defaults to rendering a "label" | "legend" | Default value label |
Prop className# | Description and type Type: string | Default value |
Prop aria-label# | Description and type Defines a string value that labels the current element. string | Default value |
Prop data-test-subj# | Description and type Type: string | Default value |
Prop css# | Description and type Type: Interpolation<Theme> | Default value |
Prop display# | Description and type
"center" | "row" | "columnCompressed" | "centerCompressed" | "rowCompressed" | Default value row |
Prop hasEmptyLabelSpace# | Description and type Useful for inline form layouts, primarily for content that boolean | Default value false |
Prop fullWidth# | Description and type Expand to fill 100% of the parent. boolean | Default value false |
Prop describedByIds# | Description and type IDs of additional elements that should be part of children's string[] | Default value |
Prop hasChildLabel# | Description and type Escape hatch to not render duplicate labels if the child also renders a label boolean | Default value true |
Prop children# | Description and type ReactElement to render as this component's content ReactElement<any, string | JSXElementConstructor<any>> & ReactNode | Default value |
Prop label# | Description and type Type: ReactNode | Default value |
Prop labelAppend# | Description and type Adds an extra node to the right of the form label without any | Default value |
Prop id# | Description and type Type: string | Default value |
Prop isInvalid# | Description and type Type: boolean | Default value |
Prop error# | Description and type Type: ReactNode | ReactNode[] | Default value |
Prop helpText# | Description and type Adds a single node/string or an array of nodes/strings below the input ReactNode | ReactNode[] | Default value |
Prop isDisabled# | Description and type Passed along to the label element; and to the child field element when boolean | Default value |