Skip to content

Text

This component generates a textfield to be used in the author dialog. The textfield’s value is passed to the component as a prop.

Properties

PropertyTypeDescriptionDefault ValueRequired
labelstringThe label of the text componentYes
placeholderstringPlaceholder text for the input fieldAny titleNo
tooltipstringTooltip text for the input fieldNo
defaultValuestringDefault value for the text componentHello WorldNo
validationRegexstringRegular expression for validation^Hello World$No
validationErrorMessagestringError message displayed when validation failsThe text must be “Hello World”No

Example

To use a text component in the author dialog, we can use the following code:

{
title: text({
label: 'Title',
placeholder: 'Any title',
tooltip: 'The title of the component',
defaultValue: 'Hello World',
validationRegex: '^Hello World$',
validationErrorMessage: 'The text must be "Hello World"',
})
}

Example in author dialog

Text Component