+
+ A simple wrapper around{' '}
+ {''}.
+
+
+
+
+ EuiTextField is currently the
+ only field component to accept{' '}
+
+ EuiFormRow
+ {' '}
+ props directly. For instance, when providing the{' '}
+ label prop, it will automically wrap itself
+ in a EuiFormRow. Other examples of promoted
+ props include helpText,{' '}
+ error , and display.
+ Providing form row props at this level also decreases the need
+ for duplicate props like isInvalid and{' '}
+ fullWidth.
+
+
+
+ >
+ ),
source: [
{
type: GuideSectionTypes.JS,
code: fieldTextSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: fieldTextHtml,
- },
],
snippet: fieldTextSnippet,
props: {
@@ -231,10 +238,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: fieldSearchSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: fieldSearchHtml,
- },
],
snippet: fieldSearchSnippet,
props: {
@@ -250,10 +253,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: fieldNumberSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: fieldNumberHtml,
- },
],
snippet: fieldNumberSnippet,
props: {
@@ -269,10 +268,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: fieldPasswordSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: fieldPasswordHtml,
- },
],
snippet: fieldPasswordSnippet,
props: {
@@ -288,10 +283,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: selectSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: selectHtml,
- },
],
text: (
@@ -323,10 +314,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: textAreaSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: textAreaHtml,
- },
],
snippet: textAreaSnippet,
props: {
@@ -342,10 +329,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: filePickerSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: filePickerHtml,
- },
],
text: (
@@ -397,10 +380,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: checkboxSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: checkboxHtml,
- },
],
snippet: checkboxSnippet,
props: {
@@ -416,10 +395,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: checkboxGroupSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: checkboxGroupHtml,
- },
],
props: {
EuiCheckboxGroup,
@@ -443,10 +418,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: radioSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: radioHtml,
- },
],
snippet: radioSnippet,
props: {
@@ -462,10 +433,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: radioGroupSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: radioGroupHtml,
- },
],
props: {
EuiRadioGroup,
@@ -493,10 +460,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: switchSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: switchHtml,
- },
],
snippet: switchSnippet,
props: {
@@ -512,10 +475,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: fieldsetSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: fieldsetHtml,
- },
],
text: (
@@ -588,10 +547,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: PrependAppendSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: PrependAppendHtml,
- },
],
demo: ,
snippet: [
@@ -612,10 +567,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: formControlLayoutSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: formControlLayoutHtml,
- },
],
text: (
@@ -653,10 +604,6 @@ export const FormControlsExample = {
type: GuideSectionTypes.JS,
code: formControlLayoutRangeSource,
},
- {
- type: GuideSectionTypes.HTML,
- code: formControlLayoutRangeHtml,
- },
],
text: (
diff --git a/src-docs/src/views/form_controls/playground.js b/src-docs/src/views/form_controls/playground.js
index 3cef0404b5e..f7e48e2d7cb 100644
--- a/src-docs/src/views/form_controls/playground.js
+++ b/src-docs/src/views/form_controls/playground.js
@@ -22,6 +22,27 @@ export const FieldTextConfig = () => {
: EuiFieldText.__docgenInfo;
const propsToUse = propUtilityForPlayground(docgenInfo.props);
+ propsToUse.label = {
+ ...propsToUse.label,
+ type: PropTypes.String,
+ value: 'Text field label',
+ };
+
+ propsToUse.error = {
+ ...propsToUse.error,
+ type: PropTypes.String,
+ };
+
+ propsToUse.labelAppend = {
+ ...propsToUse.labelAppend,
+ type: PropTypes.String,
+ };
+
+ propsToUse.helpText = {
+ ...propsToUse.helpText,
+ type: PropTypes.String,
+ };
+
propsToUse.append = {
...propsToUse.append,
type: PropTypes.String,
diff --git a/src-docs/src/views/form_controls/prepend_append.js b/src-docs/src/views/form_controls/prepend_append.js
index 4e5751a1222..788112f2866 100644
--- a/src-docs/src/views/form_controls/prepend_append.js
+++ b/src-docs/src/views/form_controls/prepend_append.js
@@ -180,6 +180,16 @@ export default () => {
readOnly={isReadOnly}
aria-label="Use aria labels when no actual label is in use"
/>
+
+
);
};
diff --git a/src-docs/src/views/form_layouts/described_form_group.js b/src-docs/src/views/form_layouts/described_form_group.js
index de21d37e96e..5ddac1d6f6a 100644
--- a/src-docs/src/views/form_layouts/described_form_group.js
+++ b/src-docs/src/views/form_layouts/described_form_group.js
@@ -35,14 +35,10 @@ export default () => {
}
>
-
-
-
+
No description}>
-
-
-
+
Multiple fields}
@@ -98,13 +94,12 @@ export default () => {
/>