Skip to content
Accessibility: Partial
Translations: Not Needed

Text Area

Text area component. A type of HLInput that allows for multi-line text input.

Note

HLInput with type="textarea" is Textarea component.

Default

Please Input
Vue
html
<template>
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area" type="textarea" />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

All Sizes

lg

Please Input

md

Please Input

sm

Please Input

xs

Please Input

2xs

Please Input

3xs

Please Input
Vue
html
<template>
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-lg" size="lg" type="textarea" />
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-md" size="md" type="textarea" />
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-sm" size="sm" type="textarea" />
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-xs" size="xs" type="textarea" />
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-2xs" size="2xs" type="textarea" />
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-3xs" size="3xs" type="textarea" />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

Show Count with Max Limit

Please Input
0 / 100
Vue
html
<template>
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-3xs" size="3xs" type="textarea" showCount :maxlength="100" />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

Disabled

Please Input
Vue
html
<template>
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-disabled" size="3xs" type="textarea" disabled />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

Custom font styles

Please Input
Vue
html
<template>
  <HLInput
    v-model:modelValue="inputModelValue"
    id="example-text-area-custom-font"
    size="3xs"
    type="textarea"
    font-size="var(--hr-font-size-4xl)"
    font-weight="var(--hr-font-weight-semibold)"
  />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

Loading

Please Input
Vue
html
<template>
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-loading" size="3xs" type="textarea" loading />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

Readonly

Vue
html
<template>
  <HLInput :modelValue="'This is read only text'" id="example-text-area-readonly" size="3xs" type="textarea" readonly />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
</script>

Clearable

Please Input
Vue
html
<template>
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-clearable" size="3xs" type="textarea" clearable />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

showCount

Please Input
0
Vue
html
<template>
  <HLInput v-model:modelValue="inputModelValue" id="example-text-area-show-count" size="3xs" type="textarea" showCount />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

Inline Textarea

Minimalist textarea that appears as text until focused, perfect for in-place editing. The inline textarea will show an ellipsis and tooltip for long overflowing text.

Click to edit...
Vue
html
<template>
  <HLInput
    v-model:modelValue="inputModelValue"
    id="example-textarea-inline"
    type="textarea"
    inline
    placeholder="Click to edit..."
    :showInlineBottomBorder="false"
    rows="3"
  />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

Inline Textarea with CTA Buttons

Inline textarea with confirm and cancel actions for explicit user control.

Click to edit with confirm/cancel...
Vue
html
<template>
  <HLInput
    v-model:modelValue="inputModelValue"
    type="textarea"
    inline
    showInlineCTA
    placeholder="Click to edit with confirm/cancel..."
    :showInlineBottomBorder="false"
    rows="3"
  />
</template>
<script setup lang="ts">
  import { HLInput } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const inputModelValue = ref('')
</script>

Imports

ts
import { HLInput } from '@platform-ui/highrise'

Props

NameTypeDefaultDescription
id *string | undefinedundefinedThe id of the element
modelValuestring''The value of the input
readonlybooleanfalseIf true, the input is read-only
rowsnumber3Number of rows for textarea
clearablebooleanfalseIf true, a clear button is shown
size'lg' | 'md' | 'sm' | 'xs' | '2xs' | '3xs''sm'The size of the input
placeholderstring | undefinedundefinedPlaceholder text for the input
autosizeboolean | AutosizeConfig | undefinedundefinedIf true, the textarea auto-resizes
maxlengthnumber | undefinedundefinedMaximum number of characters allowed
minlengthnumber | undefinedundefinedMinimum number of characters required
loadingboolean | undefinedundefinedIf true, a loading indicator is shown
showCountboolean | undefinedundefinedIf true, character count is shown
disabledboolean | undefinedundefinedIf true, the input is disabled
inputPropsObjectundefinedAdditional properties for the input element
prefixIconstring | undefinedundefinedsrc of the image to render
suffixIconstring | undefinedundefinedsrc of the image to render
suffixIconTooltipContentstring | undefinedundefinedTooltip content of suffix icon
textAlign'start' | 'center' | 'end'startText,Placeholder alignment of the input
inlinebooleanfalseTransforms textarea into inline editable field
showInlineCTAbooleanfalseShows confirm/cancel buttons during editing
showInlineBottomBorderbooleantrueControls bottom border visibility in inline mode
fontSizestring | undefinedundefinedFont size of the input text area
fontWeightstring | undefinedundefinedFont weight of the input text area

Types

ts
// Configuration for auto-sizing textarea
interface AutosizeConfig {
  minRows?: number
  maxRows?: number
}

Type Details

AutosizeConfig

  • minRows: Minimum number of rows for textarea
  • maxRows: Maximum number of rows for textarea

Types

ts
// Configuration for auto-sizing textarea
interface AutosizeConfig {
  minRows?: number
  maxRows?: number
}

// Input sizes
type HLInputSize = 'lg' | 'md' | 'sm' | 'xs' | '2xs' | '3xs'

Type Details

AutosizeConfig

  • minRows: Minimum number of rows for textarea
  • maxRows: Maximum number of rows for textarea

Emits

NameDefaultTrigger
@update:modelValue(value: string | [string, string]) => voidWhen the input value changes
@change(value: string) => voidWhen native change event is fired
@focus(FocusEvent) => voidWhen the input is focused
@blur(FocusEvent) => voidWhen the input is blurred
@keydown(event: KeyboardEvent) => voidWhen the keydown event is fired
@confirm(value: string) => voidWhen an inline input is confirmed using the confirm CTA
@cancel(value: string) => voidWhen an inline input is cancelled using the cancel CTA

Slots

NameParametersDescription
default()The default content slot
prefix()Prefix content slot
suffix()Suffix content slot
edit-actions()Inline input only: Custom action buttons that appear on hover when not editing (e.g., icons)

Methods

MethodTypeDescription
focus()() => voidFocuses the input
blur()() => voidBlurs the input
select()() => voidSelects the input
scrollTo(value: number)(value: number) => voidScrolls the input to a specific position