• /
  • Log in
  • Start now

MultilineTextField

Component used for multiline input purposes in forms.

Usage

import { MultilineTextField } from 'nr1'

Examples

Basic

ReferenceError: MultilineTextField is not defined

Preformatted

ReferenceError: MultilineTextField is not defined

Loading

ReferenceError: MultilineTextField is not defined

Disabled

ReferenceError: MultilineTextField is not defined

Read only

ReferenceError: MultilineTextField is not defined

Invalid

ReferenceError: MultilineTextField is not defined

Invalid with a reason

ReferenceError: MultilineTextField is not defined

Props

autoFocusboolean
DEFAULT
false

If true, the multiline text field will autofocus on mount.

classNamestring

Appends class names to the component.

Should be used only for positioning and spacing purposes.

defaultValuestring

Default value of the multiline text field.

disabledboolean

Establishes whether the field can be editable or not.

infostring

Additional information can be displayed in an info tooltip next to the Label.

invalidboolean|string

When true, sets the field in an invalid state, in order to notify the user attention is needed over this particular field. This property can be a boolean field or a string. When being a string, aside from the invalid state being shown, the text will be shown below.

labelstring

Text to display as label.

loadingboolean

If loading a list of data or something else into a form field, indicate to the user that something is loading by using the loading state form.

Used to inform that the field might load values dynamically. When set to true, shows a loading spinner; and when set to false, reserves some space in the UI so that the spinner can potentially be shown.

Do not set the property (or set it to undefined) if the field is not expected to get loading at any given point in time.

onBlurfunction

Callback which is fired when the multiline text field loses focus.

function (
event: Event //

Event source of the callback.

) => undefined
onChangefunction

Callback which is fired when the multiline text field value changes.

function (
event: Event //

Event source of the callback. You can pull out the new value by accessing event.target.value.

) => undefined
onFocusfunction

Callback which is fired when the multiline text field gets focus.

function (
event: Event //

Event source of the callback.

) => undefined
onKeyDownfunction

Callback which is fired when a key is pressed.

function (
event: Event //

Event source of the callback.

) => undefined
onKeyUpfunction

Callback which is fired when a key is released.

function (
event: Event //

Event source of the callback.

) => undefined
placeholderstring

Hint displayed in the multiline text field when it has no value.

readOnlyboolean

If true, makes the multiline text field read only.

rowsnumber
DEFAULT
5

Amount of rows in the text field.

The minimum required is five rows.

spacingTypeenum[]

Spacing property. Spacing is defined as a tuple of zero to four values, which follow the same conventions as CSS properties like margin or padding. To omit a value, use SPACING_TYPE.OMIT.

<Array of
<One of
MultilineTextField.SPACING_TYPE.EXTRA_LARGE,
MultilineTextField.SPACING_TYPE.LARGE,
MultilineTextField.SPACING_TYPE.MEDIUM,
MultilineTextField.SPACING_TYPE.NONE,
MultilineTextField.SPACING_TYPE.OMIT,
MultilineTextField.SPACING_TYPE.SMALL,
>
>
spellCheckboolean

If true, enables the browser check for spelling errors.

styleobject

Inline style for custom styling.

Should be used only for positioning and spacing purposes.

testIdstring

Adds a data-test-id.

Used to target the component in unit and e2e testing.

typeenum
DEFAULT
MultilineTextField.TYPE.NORMAL
  • NORMAL — when a user inputs text into a field
  • PERFORMATTED — when a user needs to enter monospaced content
<One of
MultilineTextField.TYPE.NORMAL,
MultilineTextField.TYPE.PREFORMATTED,
>
valuestring

Value of the multiline text field.

This is required for a controlled component.

Methods

MultilineTextField.render

function () => undefined
Edit this pageCreate an issue
Copyright © 2021 New Relic Inc.

This site uses cookies 🍪

We use cookies and other similar technologies ("Cookies") on our websites and services to enhance your experience and to provide you with relevant content. By using our websites and services you are agreeing to the use of cookies. You can read more here. If you consent to our cookies, please click Yes.