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>

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>

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

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
@onBlur(): voidWhen the input is blurred
@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

Slots

NameParametersDescription
default()The default content slot
prefix()Prefix content slot
suffix()Suffix content slot

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