Skip to content

Textarea

Displays a form textarea or a component that looks like a textarea.

Basic

Value:

Example

Auto Height

Automatically adjusts its height based on the content.

Example

Disabled

Example

With Label

Your message will be copied to the support team.

Example

With Character Count

84 / 100
Example

With Clear Button

Example

Error State

Please enter a valid message.

Example

Sizes

Example

Resize Behavior

You can control the resize behavior using the resize prop.

Example

Theming

You can customize the appearance of the textarea using Tailwind CSS classes or by overriding the CSS variables in your global CSS.

Global Theme Configuration

The BrTextarea component respects the global theme configuration provided by BrConfigProvider.

vue
<script setup>
import { BrConfigProvider, BrTextarea } from '@breezeui/vue'

const theme = {
  primary: '#10b981', // Emerald 500
  radius: 0.75, // 0.75rem
}
</script>

<template>
  <BrConfigProvider :theme="theme">
    <BrTextarea placeholder="Themed Textarea" />
  </BrConfigProvider>
</template>

Tailwind Customization

You can also use class prop to add custom styles:

vue
<BrTextarea class="border-purple-500 focus-visible:ring-purple-500 min-h-[150px]" />

API

Props

PropTypeDefaultDescription
modelValuestring | number-The value of the textarea.
defaultValuestring | number-The default value of the textarea.
disabledbooleanfalseWhether the textarea is disabled.
readonlybooleanfalseWhether the textarea is read-only.
placeholderstring-Placeholder text.
sizedefault | xs | sm | md | lg | xl | 2xldefaultThe size of the textarea.
errorbooleanfalseWhether to show error state.
clearablebooleanfalseWhether to show a clear button when input has value.
autoSizeboolean | objectfalseWhether to automatically adjust height.
rowsnumber | string3The visible number of lines.
maxlengthnumber | string-The maximum number of characters allowed.
showCountbooleanfalseWhether to show character count (requires maxlength).
resizenone | vertical | horizontal | bothverticalThe resize behavior.

Events

NamePayloadDescription
update:modelValuestring | numberEmitted when textarea value changes.
clear-Emitted when the clear button is clicked.
inputEventEmitted when the textarea value changes.
changeEventEmitted when the textarea value changes (on blur).
focusEventEmitted when the textarea is focused.
blurEventEmitted when the textarea is blurred.