Textarea

Overview of the Textarea Component

The TextareaWrapper component is used for multi-line text input. A native Textarea element is rendered inside of the component. The user experience and interactivity of the TextareaWrapper component is improved by having control over the native Textarea.

Unlike the native Textarea element, the Ionic Textarea does not support loading its value from the inner content. The Textarea value should be set in the value attribute.

The TextareaWrapper component accepts the native Textarea attributes in addition to the Ionic properties.

Properties

🚧

Important Note!

This document lists the properties that are specific to this particular UI component.
To check for the properties common for most UI components, please check the General components document.

Every new TextareaWrapper component is created with two default child components: Textarea and ItemLabel.

Common Properties

Property NameProperty Description
Item WrappedIf set to true, the component will be included in the Item with additional properties
Show LabelIf set to true, the component will have a label.
LinesHow the bottom border should be displayed on the item. Possible values are; Full, Inset, None.
ReorderReorder properties:
Type - Content or Wrapper. If Wrapper is used, the item will be wrapped into a reorder tag.
Icon - custom icon for Reorder with a type Content. Click the Default icon button to select the needed icon.
Slot - position inside the item: Start or End.
SVG Icon - used to select an svg file. This path will be added as the src attribute. Click the Change button to select the uploaded image from Media Manager.

Textarea

Setting the Textarea component properties can be done from under Common and/or Styles tabs:

Common Properties

Property NameProperty Description
NameThe name of the control, which is submitted with the form data
ValueThe textarea value.
PlaceholderInstructional text that shows before the input has a value.
Placeholder I18nIf set to True then use the Placeholder property for internationalization.
ColsThe visible width of the text control, in average character widths. If it is specified, it must be a positive integer.
RowsThe number of visible text lines for the control.
Auto GrowIf set to true, the element height will increase based on the value.
DebounceThe amount of time set in milliseconds, to wait to trigger the ionChange event after each keystroke. This also impacts form bindings such as ngModel or v-model. The default is set to 0.
ReadonlyIf set to true, the value cannot be modified.
WrapIndicate how the control wraps text: Hard, Off or Soft.
[(ngModel)]Angular directive for data binding.
(ionBlur)The event emitted when the input option is blurred.
(ionChange)The event emitted when the input value has changed.
(ionFocus)The event emitted when the input option has focus.
(ionInput)The event emitted when a keyboard input occurs.

Textarea Features Properties

Property NameProperty Description
AutocapitalizeIndicate whether and how the text value should be automatically capitalized while being entered/edited by the user.
AutofocusThis Boolean attribute allows specifying that a form control should have input focus when the page loads. Defaults are set to false.
Clear On EditIf set to true, the value will be cleared after focus upon edit.
EnterkeyhintA hint to the browser for which enter key to display. Possible values: enter, done, go, next, previous, search, and send.
InputmodeA hint to the browser for which keyboard to display. Possible values: none, text, tel, url, email, numeric, decimal, and search.
MaxlengthThis attribute specifies the maximum number of characters that can be entered.
MinlengthThis attribute specifies the minimum number of characters that can be entered.
RequiredIf set to true, the user must fill in a value before submitting a form.
SpellcheckIf set to true, the user must fill in a value before submitting a form.

Styles Properties

Property NameProperty Description
Text ColorSelect CSS color from the available colors: Primary, Secondary, Tertiary, Success, Warning, Danger, Light, Medium, Dark, and Custom or use the Color-picker.

ItemLabel

The ItemLabel component has the following properties:

Common Properties

Property NameProperty Description
Truncate TextSet to True (default) to truncate label text if it is too long.
PositionThe position determines where and how the label behaves inside an item.

Styles Properties

Under the Styles tab, ItemLabel components can be styled with the following attributes to look like in a specific way:

Property NameProperty Description
Font SizeEnter font size in px, %, em, vh, and vw.
Font WeightSet the weight (or boldness) of the font: Normal or Bold.

Visit the Ionic documentation to read more about Textarea.