Represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form.

Element
igc-textarea
Slots
default — Text content from the default slot will be used as the value of the component.
prefix — Renders content before the input.
suffix — Renders content after input.
helper-text — Renders content below the input.
value-missing — Renders content when the required validation fails.
too-long — Renders content when the maxlength validation fails.
too-short — Renders content when the minlength validation fails.
custom-error — Renders content when setCustomValidity(message) is set.
invalid — Renders content when the component is in invalid state (validity.valid = false).
CSS Parts
container — The main wrapper that holds all main input elements of the textarea.
input — The native input element of the textarea.
label — The native label element of the textarea.
prefix — The prefix wrapper of the textarea.
suffix — The suffix wrapper of the textarea.
helper-text — The helper text wrapper of the textarea.

Controls whether and how text input is automatically capitalized as it is entered/edited by the user.

MDN documentation.

autocapitalize: string

Defined in src/components/textarea/textarea.ts:159

Specifies what permission, if any, the browser has to provide automated assistance in filling out form field values, as well as guidance to the browser as to the type of information expected in the field. Refer to this page for additional information.

autocomplete: string

Defined in src/components/textarea/textarea.ts:149

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

The disabled state of the component.

disabled: boolean

Defined in src/internals/mixins/forms/types.ts:30

Hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard.

MDN documentation

inputMode: string

Defined in src/components/textarea/textarea.ts:170

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

Sets the control into invalid state (visual state only).

invalid: boolean

Defined in src/internals/mixins/forms/types.ts:37

The label for the control.

label: string

Defined in src/components/textarea/textarea.ts:178

The maximum number of characters (UTF-16 code units) that the user can enter. If this value isn't specified, the user can enter an unlimited number of characters.

maxLength: number

Defined in src/components/textarea/textarea.ts:187

The minimum number of characters (UTF-16 code units) required that the user should enter.

minLength: number

Defined in src/components/textarea/textarea.ts:195

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

The name of the control, submitted with the form data.

name: string

Defined in src/internals/mixins/forms/types.ts:43

Whether the control will have outlined appearance.

outlined: boolean = false

Defined in src/components/textarea/textarea.ts:202

The placeholder text of the control.

placeholder: string

Defined in src/components/textarea/textarea.ts:210

Makes the control a readonly field.

readOnly: boolean = false

Defined in src/components/textarea/textarea.ts:218

Controls whether the control can be resized. When auto is set, the control will try to expand and fit its content.

resize: TextareaResize = 'vertical'

Defined in src/components/textarea/textarea.ts:227

The number of visible text lines for the control. If it is specified, it must be a positive integer. If it is not specified, the default value is 3.

rows: number = 3

Defined in src/components/textarea/textarea.ts:236

Controls whether the element may be checked for spelling errors.

spellcheck: boolean = true

Defined in src/components/textarea/textarea.ts:265

Enables validation rules to be evaluated without restricting user input. This applies to the maxLength property when it is defined.

validateOnly: boolean = false

Defined in src/components/textarea/textarea.ts:284

Indicates how the control should wrap the value for form submission. Refer to this page on MDN for explanation of the available values.

wrap: "off" | "hard" | "soft" = 'soft'

Defined in src/components/textarea/textarea.ts:275

The tagName read-only property of the Element interface returns the tag name of the element on which it's called.

MDN Reference

tagName: "igc-textarea" = 'igc-textarea'

Defined in src/components/textarea/textarea.ts:95

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

get defaultValue(): any

Defined in src/internals/mixins/forms/types.ts:182

The initial value of the component.

set defaultValue(value: unknown): void

Defined in src/internals/mixins/forms/types.ts:182

Parameters

  • value: unknown

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

Returns the HTMLFormElement associated with this element.

get form(): HTMLFormElement | null

Defined in src/internals/mixins/forms/types.ts:46

Returns HTMLFormElement | null

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

get required(): any

Defined in src/internals/mixins/forms/types.ts:207

When set, makes the component a required field for validation.

set required(value: boolean): void

Defined in src/internals/mixins/forms/types.ts:207

Parameters

  • value: boolean

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

A string containing the validation message of this element.

get validationMessage(): string

Defined in src/internals/mixins/forms/types.ts:55

Returns string

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

Returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.

get validity(): ValidityState

Defined in src/internals/mixins/forms/types.ts:52

Returns ValidityState

get value(): any

Defined in src/components/textarea/textarea.ts:245

The value of the component

set value(value: string): void

Defined in src/components/textarea/textarea.ts:245

Parameters

  • value: string

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.

get willValidate(): boolean

Defined in src/internals/mixins/forms/types.ts:61

Returns boolean

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

Checks for validity of the control and emits the invalid event if it's invalid.

checkValidity(): boolean

Defined in src/internals/mixins/forms/types.ts:166

Returns boolean

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

Checks for validity of the control and shows the browser message if it's invalid.

reportValidity(): boolean

Defined in src/internals/mixins/forms/types.ts:169

Returns boolean

The scrollTo() method of the Element interface scrolls to a particular set of coordinates inside a given element.

MDN Reference

scrollTo(options: ScrollToOptions): void

Defined in src/components/textarea/textarea.ts:401

Parameters

  • options: ScrollToOptions

Returns void

Selects all text within the control.

select(): void

Defined in src/components/textarea/textarea.ts:374

Returns void

Inherited from: FormAssociatedRequiredMixin( EventEmitterMixin<IgcTextareaComponentEventMap, Constructor<LitElement>>( LitElement ) )

Sets a custom validation message for the control. As long as message is not empty, the control is considered invalid.

setCustomValidity(message: string): void

Defined in src/internals/mixins/forms/types.ts:175

Parameters

  • message: string

Returns void

Replaces the selected text in the control.

setRangeText(replacement: string, start: number, end: number, selectMode: RangeTextSelectMode): void

Defined in src/components/textarea/textarea.ts:390

Parameters

  • replacement: string
  • start: number
  • end: number
  • selectMode: RangeTextSelectMode

Returns void

Sets the text selection range of the control

setSelectionRange(start: number, end: number, direction: SelectionRangeDirection): void

Defined in src/components/textarea/textarea.ts:380

Parameters

  • start: number
  • end: number
  • direction: SelectionRangeDirection

Returns void