<Text>
The <Text>
component is used for form inputs where the user enters text.
Examples include names and emails.
Use of <Text>
<Textid="email"name="email"isRequiredlabelHtml={{en: 'What is your email?',}}hintHtml={{en: '<abbr title="For example">E.g.</abbr> user@example.com',}}rows={1}/>
<Text>
's props
Prop | About | Type |
---|---|---|
autoComplete | The Using this is a WCAG requirement since WCAG 2.1. This attribute is useful for those who have problems filling in forms as it can prefill field with an answer that can be confirmed. | "email" | "tel" | "url" | "off" | "name" | "organization-title" | "street-address" | "country" | "postal-code" | "bday" | "sex" | "photo" | "one-time-code" | "address-line1" | "address-line2" | "address-line3" | "address-level2" |
hideInAnswerSummary | Whether to hide any answers below this. | boolean |
hintHtml | Localisable HTML: hint content E.g.
| LocalisedHtml |
inputResize | CSS 'resize' property (MDN | "none" | "both" | "horizontal" | "vertical" |
inputType | Indicates the type of input expected, but not necessarily via the For example | "number" | "text" | "email" | "hidden" | "search" | "tel" | "url" |
isRequired | Whether users are required to fill in this form field. This setting affects | boolean |
labelHelpPopoutContentButtonLabel | Localisable text: Popout Content button label | LocalisedPlainText |
labelHelpPopoutContentModalContentHtml | Localisable text: Popout Content modal title | LocalisedHtml |
labelHelpPopoutContentModalHeadingHtml | Localisable text: Popout Content modal title | LocalisedHtml |
labelHtml | Localisable HTML: label content E.g.
| LocalisedHtml |
name | The Name of the form control. Submitted with the form as part of a name:value pair in the | string |
placeholder | Localisable PlainText: placeholder content. Placeholder content may cause accessibility problems as users can confuse it with their own form values.
With Typically this should be left empty. E.g.
| LocalisedPlainText |
rows | Number of lines of text content in the input. This may affect whether an | number |
spellcheck | The | boolean |
tagsById | A list of tags for this form field. | string[] |
validationErrorInvalidHtml | Localisable HTML: invalid field error content E.g.
| LocalisedHtml |
validationErrorRequiredHtml | Localisable HTML: required field error content E.g.
| LocalisedHtml |
id | Component Id. Must be unique within the form. | string |
meta | Arbitrary metadata on this node. This is useful when developing custom controls as it allows you to pass down metadata/extensions. | string |
hasChildrenById | Non-editable. Used to indicate that this component doesn't have children. | false |
hasTagsById | Non-editable. Used to indicate that this component has tags by id. | true |
isFormField | Non-editable. Used to indicate that this component is a form field. | true |
isMultichoice | Non-editable. Used to indicate that this component isn't a multichoice form field like | false |
type | Non-editable. Type of component of | "Text" |