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:162

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:152

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

The disabled state of the component.

disabled: boolean

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

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:173

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:39

The label for the control.

label: string

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

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:190

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

minLength: number

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

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:45

Whether the control will have outlined appearance.

outlined: boolean = false

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

The placeholder text of the control.

placeholder: string

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

Makes the control a readonly field.

readOnly: boolean = false

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

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:230

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:239

Controls whether the element may be checked for spelling errors.

spellcheck: boolean = true

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

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:287

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:278

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:98

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

get defaultValue(): any

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

The initial value of the component.

set defaultValue(value: unknown): void

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

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:48

Returns HTMLFormElement | null

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

get required(): any

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

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

set required(value: boolean): void

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

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:54

Returns string

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

Returns a ValidityState object for the element.

get validity(): ValidityState

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

Returns ValidityState

get value(): any

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

The value of the component

set value(value: string): void

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

Parameters

  • value: string

Returns void

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

Returns true when the element is a candidate for constraint validation.

get willValidate(): boolean

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

Returns boolean

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

Checks validity and emits invalid when the control is invalid.

checkValidity(): boolean

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

Returns boolean

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

Checks validity and shows the browser message when invalid.

reportValidity(): boolean

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

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:404

Parameters

  • options: ScrollToOptions

Returns void

Selects all text within the control.

select(): void

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

Returns void

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

Sets a custom message. Invalid while message is not empty.

setCustomValidity(message: string): void

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

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:393

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:383

Parameters

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

Returns void