Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

Textarea

Used to enter long text input which spans over multiple lines

banner-Textarea
Component Status Details

Status component contains a list of checks and completeness that has been tested and owned by each component

check-list-icon We don't use color as the only visual tool to convey information.
check-list-icon The component’s structure and properties include relevant options such as variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.check-list-icon The title is the component name that uses the frame base component template.check-list-icon The base component name contains: .Base & "Component Name" if there is more than one.check-list-icon All component properties use the Legion foundation.
check-list-icon We can change all the parts that are connected to the component base.check-list-icon The inside of the base component remains connected to the master component.check-list-icon All variant options are not damaged when we change from one to another.check-list-icon Overriding changes to components will not reset other variants.
check-list-icon Component's already has component specs documentation.

Status

Resources

Upcoming

Usage

Textarea allow user input. The border should light up simply and clearly indicating which field the user is currently editing.

Basic

Here’s the default usage of Textarea with placeholder and label attribute set.

basic textarea

Static in xml

<com.telkom.legion.component.textfield.LgnTextAreaField
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Catatan"
app:placeholderText="Tambahkan Catatan" />

Dynamic using Kotlin*

...
with(binding) {
containerBase.addView( //ViewGroup for Dynamic Layout
LgnTextAreaField(requiredContext()).apply {
//Your View's customization here
},
LinearLayout.LayoutParams( //For example we use viewgroup LinearLayout
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT

Required Text Area

Add required status to make it easier for users to know which fields are required status, the label will automatically be added with a red asterisk mark

required text area

Static in xml

<com.telkom.legion.component.textfield.LgnTextAreaField
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Catatan"
app:isRequired="true"
app:placeholderText="Tambahkan Catatan" />

Dynamic using Kotlin*

...
with(binding) {
containerBase.addView( //ViewGroup for Dynamic Layout
LgnTextAreaField(requiredContext()).apply {
isRequired = true
//Your View's customization here
},
LinearLayout.LayoutParams( //For example we use viewgroup LinearLayout
LinearLayout.LayoutParams.MATCH_PARENT,

Optional Text Area

Add optional status to make it easier for users to know which fields are optional, labels will be automatically added text (Optional) in various languages

optional textarea

Static in xml

<com.telkom.legion.component.textfield.LgnTextAreaField
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Catatan"
app:isOptional="true"
app:placeholderText="Tambahkan Catatan" />

Dynamic using Kotlin*

...
with(binding) {
containerBase.addView( //ViewGroup for Dynamic Layout
LgnTextAreaField(requiredContext()).apply {
isOptional = true
//Your View's customization here
},
LinearLayout.LayoutParams( //For example we use viewgroup LinearLayout
LinearLayout.LayoutParams.MATCH_PARENT,

Disabled Text Area

Make textarea look inactive.

disabled textarea

Static in xml

<com.telkom.legion.component.textfield.LgnTextAreaField
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Catatan"
android:enabled="false"
app:placeholderText="Tambahkan Catatan" />

Dynamic using Kotlin*

...
with(binding) {
containerBase.addView( //ViewGroup for Dynamic Layout
LgnTextAreaField(requiredContext()).apply {
isEnable = false
//Your View's customization here
},
LinearLayout.LayoutParams( //For example we use viewgroup LinearLayout
LinearLayout.LayoutParams.MATCH_PARENT,

Error Indicator Text Area

Add an error indicator to make it easier for users to find out which fields are wrong in inputting, and provide error messages in the relevant fields

error indicator textarea

Static in xml

<com.telkom.legion.component.textfield.LgnTextAreaField
android:id="@+id/etAreaError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Catatan"
app:placeholderText="Tambahkan Catatan" />

In Your Kotlin Code

...
with(binding) {
etAreaError.error = "Your error message"
}
...

Dynamic using Kotlin*

...
with(binding) {
containerBase.addView( //ViewGroup for Dynamic Layout
LgnTextAreaField(requiredContext()).apply {
error = "Your error message"
//Your View's customization here
},
LinearLayout.LayoutParams( //For example we use viewgroup LinearLayout
LinearLayout.LayoutParams.MATCH_PARENT,

Properties

Component NameIdDescription
TextViewtvHintTo display label on text area
TextInputLayoutetBaseTo display text field on text area
TextViewtvHelperTo display helper text on text area
TextViewtvErrorTo display error text on text area

Attributes

Attribute NameXml AttrsRelated method(s)Description
Textandroid:texttextTo set Text value directly via xml
Hintandroid:hinttextTo set Hint or Label value directly via xml
Enable Statusandroid:enabledisEnableTo set enable or disable text area directly via xml
Required Statusapp:isRequiredisRequiredTo set required status on text area directly via xml
Optional Statusapp:isOptionalisOptionalTo set optional status on text area directly via xml
Placeholder textapp:placeholderTextplaceHolderTo set placeholder text directly via xml
Helper textapp:placeholderTexthelperTo set helper text directly via xml