Textarea
#

Textareas are used for multiline input. They support auto resizing, validation, and more.

Examples
#

Default
#

By default textarea is two rows input.

Open in GitHub

Label
#

You can specify label prop to add label to textarea. By default label is placed above textarea.

Open in GitHub

In case you want to keep label inside textarea, you can use :inner-label="true" prop.

Open in GitHub

Autosize
#

There are situations when you want textarea to grow in size as user types. You can use :autosize="true" prop to enable this behavior.

You can also specify minRows and maxRows props to limit textarea size.

Open in GitHub

Validation
#

With rules prop you can specify validation rules for textarea.

You can also use counter and maxLength props to limit textarea length. Notice that maxLength prop will not prevent user from typing more characters and will not show error, so you need to add validation rule manually.

Validation rule can return error message or boolean. You can also use required-mark rule to add * to label.

56/125
Open in GitHub

Props #

NameDescriptionTypesDefault
autosize

Sets textarea possibility to grow up automatically

Boolean

false

background

The color name of the background color

String

-

clearValue

Sets value that should be set after clearing

String

""

color

Sets input color

String

"primary"

counter

Shows counter

Boolean

-

dirty

Sets the dirty state of the component

Boolean

false

disabled

Disable the input

Boolean

false

error

Sets input state to error

Boolean

-

errorCount

Number of error messages displayed

String | Number

1

errorMessages

Displays a list of error messages or message if using a string

Array | String

-

immediateValidation

Sets the validation to be performed when the component is mounted

Boolean

false

innerLabel

Makes label render inside input

Boolean

false

inputAriaDescribedby

String

-

inputAriaLabel

String

"$t:inputField"

inputAriaLabelledby

String

-

label

Sets input label

String

""

loading

Indicates that something is loading (spinner icon).

Boolean

false

maxLength

Sets max length of input

Number | String

-

maxRows

Maximum count of lines

Number | String

-

messages

Displays a list of messages or message if using a string

Array | String

[]

minRows

Minimal count of lines

Number | String

1

modelValue

The value of the v-model bindings.

String | Number

""

name

Applies name to internal input component. Useful for native forms.

String

-

placeholder

Sets input placeholder

String

-

preset

Named preset combination of component props.

String | Array

-

readonly

Puts input in readonly state

Boolean

false

requiredMark

Adds required mark to the label

Boolean

false

resize

Sets textarea resize

Boolean

true

rules

Accepts an array of functions that take an input value as an argument and return either true / false or a string with an error message

Array

[]

stateful

Add possibility to work with component without setting v-model.

Boolean

false

success

Sets input state to success

Boolean

false

Events #

NameDescription

change

click

On click.

input

On value change.

update:dirty

Fires when the dirty state changes

update:error

Fires when the error state changes

update:errorMessages

Fires when the error messages change

update:modelValue

The event is triggered when the component needs to change the model. Is also used by v-model and must be listed after the v-model

Change log #

v1.8.0
  • Date input have outlined style by default

  • solid and bordered props moved to preset="solid" and preset="bordered"