forms

Textarea

Display a textarea field.

Usage

Use a v-model to make the Textarea reactive.

<script setup>
const value = ref('')
</script>
<template>
  <UTextarea v-model="value" />
</template>

Style

Use the color and variant props to change the visual style of the Textarea.

<UTextarea color="primary" variant="outline" />

Besides all the colors from the ui.colors object, you can also use the white (default) and gray colors with their pre-defined variants.

White

<UTextarea color="white" variant="outline" />

Gray

<UTextarea color="gray" variant="outline" />

Size

Use the size prop to change the size of the Textarea.

<UTextarea size="sm" />

Placeholder

Use the placeholder prop to set a placeholder text.

<UTextarea placeholder="Search..." />

Rows

Use the rows prop to set the number of rows of the Textarea.

<UTextarea :rows="1" />

Disabled

Use the disabled prop to disable the Textarea.

<UTextarea disabled />

Autoresize

Use the autoresize prop to enable the autoresize. Writing more lines than the rows prop will make the Textarea grow up.

<UTextarea autoresize />

Resize

Use the resize prop to enable the resize control.

<UTextarea resize />

Props

name
string

null

size
"sm" | "2xs" | "xs" | "md" | "lg" | "xl"

config.default.size

ui
any

undefined

color
any

config.default.color

modelValue
string | number

""

placeholder
string

null

variant
"outline" | "none"

config.default.variant

id
string

null

rows
number

3

textareaClass
string

null

required
boolean

false

disabled
boolean

false

autofocus
boolean

false

padded
boolean

true

autoresize
boolean

false

resize
boolean

false

Preset

appConfig.ui.textarea
undefined